Featured

2014年4月30日星期三

#FreeAppAlert#English Grammar for Grade 10 By Van Quoc Huy, 中國人寫的 給中國初中學生用的英文文法測驗, 有250 個小單元http://t.cn/8suZTzi


#FreeAppAlert#Ultimate Movie Trivia - Disney Edition By The App Ward, 考 ㄧ考, 你對迪士尼動畫的熟悉度 100 題等你來挑戰http://t.cn/8FMWcOZ


Art of the Day: Van Gogh, Almond Tree in Blossom, April 1888. Oil on canvas, 48.5 x 36.0 cm. Van Gogh Museum, Amsterdam. 梵高 開花的小杏桃樹 (這幅融合了歐洲和日本美學理念。梵高的畫超過他的時代 超過他的負荷 只有那 個小蝴蝶是自在的.)


伊斯蘇戰役vs德國30年戰爭.1.路德想以宗教改革團結日耳曼的夢, 最后破滅了,日 耳曼人只是更加分岐,難以團結抵抗外侮, 對羅馬教庭效忠的人依舊大有人在, 德 國畫家Albrecht Altdorfer 名畫 伊苏斯战役(Battle of Issus西元前333年)表 面上是湎懷歷史,實際上是表現他對戰爭快來的焦慮.


2014年4月29日星期二

Setup Amazon SNS Mobile Push for ios App —6


21. Push Messages from one iphone to multiple end points


NSMutableArray *arr = [DataSource getFriendAWS:kk list:self.all];

NSString *msg= [NSString stringWithFormat:

        @"您在%@%@KTV邀請喔 ~ 快來看看吧 ~",begindate,self.subject.text];
   

  for( NSString *tt in arr) {
        
        if (tt.length>5) {

            dispatch_queue_t queue = dispatch_get_global_queue
               (DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);

            dispatch_async(queue, ^{
                
                dispatch_async(dispatch_get_main_queue(), ^{
                    
                    [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
                });
                
               
                
                [[MessageBoard instance] pushToMobileEnd:msg to:tt];

                dispatch_async(dispatch_get_main_queue(), ^{
                    
                    [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
                    NSLog(@"---Mobile Push Done--");
                });
            });

            
        }
    }

Setup Amazon SNS Mobile Push for ios App —5

18. Modify end point region in MessageBoard.m :


-(id)init
{
    self = [super init];
    if (self != nil) {
        snsClient = [[AmazonSNSClient alloc] initWithAccessKey:ACCESS_KEY_ID withSecretKey:SECRET_KEY];
        snsClient.endpoint = [AmazonEndpoints snsEndpoint:US_WEST_1];//US_EAST_1

        sqsClient = [[AmazonSQSClient alloc] initWithAccessKey:ACCESS_KEY_ID withSecretKey:SECRET_KEY];
        sqsClient.endpoint = [AmazonEndpoints sqsEndpoint:US_WEST_1];
        
        // Find the Topic for this App or create one.
        topicARN = [self findTopicArn];
        if (topicARN == nil) {
            topicARN = [self createTopic];
        }
        
        // Find the Queue for this App or create one.
        queueUrl = [self findQueueUrl] ;
        if (queueUrl == nil) {
            queueUrl = [self createQueue];
            
            // Allow time for the queue to be created.
            [NSThread sleepForTimeInterval:4.0];
            
            [self subscribeQueue];
        }
        
        // Find endpointARN for this device if there is one.
        endpointARN = [self findEndpointARN] ;
        
    }
    
    return self;
}


19. Modify End Point User Default Setting :


-(bool)createApplicationEndpoint{
    
    NSString *deviceToken = [[NSUserDefaults standardUserDefaults] stringForKey:@"myDeviceToken"];
    if (!deviceToken) {
        [[Constants universalAlertsWithTitle:@"deviceToken not found!" andMessage:@"Device may fail to register with Apple's Notification Service, please check debug window for details"] show];
    }
    
    SNSCreatePlatformEndpointRequest *endpointReq = [[SNSCreatePlatformEndpointRequest alloc] init];
    endpointReq.platformApplicationArn = PLATFORM_APPLICATION_ARN;
    endpointReq.token = deviceToken;
    
    SNSCreatePlatformEndpointResponse *endpointResponse = [snsClient createPlatformEndpoint:endpointReq];
    if (endpointResponse.error != nil) {
        NSLog(@"Error: %@", endpointResponse.error);
        [[Constants universalAlertsWithTitle:@"CreateApplicationEndpoint Error" andMessage:endpointResponse.error.userInfo.description] show];
        return NO;
    }
    
    endpointARN = endpointResponse.endpointArn;
    [[NSUserDefaults standardUserDefaults] setObject:endpointResponse.endpointArn forKey:@"DEVICE_ENDPOINT"];
    [[NSUserDefaults standardUserDefaults] synchronize];
    
    return YES;
}

20. Capture iPhone device push token and create AWS End Point 


 if ([[MessageBoard instance] createApplicationEndpoint]) 
                    NSLog(@" Add end point OK");










Setup Amazon SNS Mobile Push for ios App —4


17. In your project, add following to AppDelegate.m


      #import "MessageBoard.h"
      #import <AWSRuntime/AWSRuntime.h>
      #import "Constants.h"


     - (void)application:(UIApplication*)application 

   didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken{
    
    //Convert deviceToken to String Type

    const char* data = [deviceToken bytes];

    NSMutableString* tokenString = [NSMutableString string];
   
    for (int i = 0; i < [deviceToken length]; i++) {
        [tokenString appendFormat:@"%02.2hhX", data[i]];
    }
    NSLog(@"deviceToken String: %@", tokenString);
    
    [[NSUserDefaults standardUserDefaults] setObject:tokenString 

           forKey:@"myDeviceToken"];

    [[NSUserDefaults standardUserDefaults] synchronize];
    
}

- (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error{

        NSLog(@"Failed to register with error : %@", error);
}

- (void)application:(UIApplication *)application didReceiveRemoteNotification:

    (NSDictionary *)userInfo {

    application.applicationIconBadgeNumber = 0;

    
    NSLog(@"remote notification: %@",[userInfo description]);

    NSDictionary *apsInfo = [userInfo objectForKey:@"aps"];
    
    NSString *alert = [apsInfo objectForKey:@"alert"];

    NSLog(@"Received Push Alert: %@", alert);
    
  
    
    [[UIApplication sharedApplication] cancelAllLocalNotifications];
    
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

   ......


 application.applicationIconBadgeNumber = 0;

    [[UIApplication sharedApplication] registerForRemoteNotificationTypes:

     (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound

     UIRemoteNotificationTypeAlert)];
    
    if(launchOptions!=nil){

        NSString *msg = [NSString stringWithFormat:@"%@", launchOptions];
        NSLog(@"%@",msg);
     
        NSDictionary *apsInfo = [launchOptions objectForKey:@"aps"];
        
        NSString *alert = [apsInfo objectForKey:@"alert"];
        NSLog(@"Received Push Alert launchoption: %@", alert);
         
        
        
        
    }
    [[UIApplication sharedApplication] cancelAllLocalNotifications];
    [AmazonErrorHandler shouldNotThrowExceptions];


......

}


Setup Amazon SNS Mobile Push for ios App ---3



11. Download [aws-sdk-ios-samples]

12. Find this SNS Sample project

      SNS_SQS_MessageBoard

13.Open  Constants.h and modify the following 3 values

     constant.h

#define ACCESS_KEY_ID                   @"AKXX"

#define SECRET_KEY

                 @"SOXXX"

#define PLATFORM_APPLICATION_ARN        @"arn:aws:sns:us-east-1:XXX"



14. Switch to project view and select the Message Board target.
        In the Build Settings tab, make sure Code Signing Identity has been
         set to your developer id

15.Select the follwing frameworks and click Add:

*  AWSRuntime.framework
*  AWSSNS.framework
*  AWSSQS.framework

16. Play and Feel  !!!!

Setup Amazon SNS Mobile Push for ios App ---2


6. Log in to the AWS SNS Console and Click "Add a New App"

    to create a new application.

7. Choose the p12 file you exported from keychain

8. Click Load Credentials From File

9. Application ARN will be shown in Application Details Section,

    make note of it and you will need it in the following step.



Setup Amazon SNS Mobile Push for ios App ---1

1. Add new App IDs in (iOS Dev Center/Certificates, Identifier & Profiles/Certificates)
 
    and submit

 
   App ID Description: AWS Push
   App ID:  com.xxxx.awpush

2. click Edit to configure App ID.

     click the checkbox to enable Push Notifications

3.Create Certificate
   Create and uploaded your CSR file,
   Generate your certificate and  to download .cer file to your local machine.

4. Import cer file into your Keychain.

5. Save the exported p12

For more information, please read http://docs.urbanairship.com/build/ios.html






#FreeAppAlert#Child Scripture Stories By LDS Publicity, 兒童聖經故事 http://t.cn/8smwJGz


2014年4月25日星期五

#FreeAppAlert#Anton and Mille By Bo Kalvslund, 安東小男孩與米尼狗狗的故 事書 http://t.cn/8s8NjDb



#FreeAppAlert#Video Touch - Musical Instruments By SoundTouch, 介紹樂器 的 視屏app http://t.cn/8s8N36u


#FreeAppAlert#Crazyfingers - Ships and boats By Jekolab Srl, 各種船 潛水 艇 童書繪本 http://t.cn/8Fc4e19


#FreeAppAlert#Peter Rabbit's Garden By Poppin Games, 正版彼得兔 的花園 童書繪本 http://t.cn/8s8pqt5


Art of the Day: Van Gogh, Grass and Butterflies, 1887. Oil on canvas, 51 x 61 cm. Private collection.梵高 草地 與粉蝶 (彷拂青草就在腳邊, 小野 花紋路明顯,蝴蝶筆觸柔軟細膩。多看看青草地, 會讓人舒緩緊繃的心情...流連 忘返 ,理性與美感 兼具的作品)


#art.history.idea#最後的晚餐 背對觀眾的猶大.3. 羅騰堡聖雅各教堂西廊有著 名的聖血祭壇屏風, 以木雕表現最后的晚餐,16世紀的德國人, 進教會找神父告 解,如同猶大看著聖philip的角度, philip ㄧ手指著地, 對你說 你想被救贖, 還 是要學猶大下地獄? 木雕中的猶大就是-你,藝術品成功融入觀眾的巧妙安排.



2014年4月23日星期三

#FreeAppAlert#Toy Repair Workshop By Sebastian Bachorzewski, 修理玩具工 作室, 給小朋友充滿意義有成就感的app , 將支離破碎的布娃娃 泰迪熊 玩具車 玩具機器人 全都修ㄧ修 http://t.cn/8sHTY5E


#FreeAppAlert#Living vs Nonliving : Do you know which ones will grow? By CJ Educations, 由小朋友朗誦配音的可愛韻文繞口令 互動小書, 帽子有沒有 生命 , 牛有沒有生命 ,區別ㄧ下 生物 與無生物 http://t.cn/8sHHvXM


#FreeAppAlert#The Truth About Mermaid By Pehuen Editores S.A., 有那些小 朋友相信世界上有美人魚的存在? 跟著這本小粉紅故事書 來挖掘小小美人魚的八 卦 吧 http://t.cn/8sHHccF


#FreeAppAlert#Bibo, the little monster By Vasiliy Poryagin, 畢波小野獸 夢幻故事書 粉紫萌翻天的小怪怪 在森林中的英雄事蹟, 讓您的孩子 在奇幻森林 與 小怪怪 來場驚奇的邂逅 http://t.cn/8sHHHVh


#FreeAppAlert#Green Radventures: Book 2 HD By Snowball, 綠色地球生態系 統 童書繪本, 以生動的方式 說說 植物光合作用 , 植物成為人類的蔬果與主 食 , 還有 陽光 空氣 水 , 造物者對人類的恩賜 http://t.cn/8sHQyYd


2014年4月22日星期二

#FreeAppAlert#Marine Missions By National Geographic Society, 世界地球 日, 美國國家地理雜誌 要告訴小朋友 要好好寶貝海洋生態 , 海洋生物與人類生 存休戚與共 唇齒相依 http://t.cn/8sTuUXN


#FreeAppAlert#Earth Day Carol By Zippy Brain Inc. 世界地球日公益App, 生 動活潑的說唱繪本, 別在地球媽媽身上塞滿塑膠瓶. 不要再污染我們唯ㄧ的家園 還給人類一個純淨的生存空間http://t.cn/8sTuXXZ




#FreeAppAlert#A Seed Grows - By Language Technologies, Inc. Reading-Z.com這家公司的美語閱讀分級課程, 是所有美國小學生必讀的初級教 材, 這app可惜,沒聲音 , 沒 互動 純閱讀 描述小小種子的成長 http://t.cn/8sTumLq


#FreeAppAlert#DIY Sun Science By The Lawrence Hall of Science, 美國小朋 友的理科 是這種DIY 動手動腦啟發 加以原理引導思考 http://t.cn/8sT3LKW



Art of the Day: Van Gogh, Square Saint-Pierre, Spring 1887. (梵高總共在 巴黎遊學兩年, 結交點描派的畫家朋友, 從ㄧ位傳統畫家蛻變成為具有實驗冒險精 神的藝術家,從印象派學到了直率跟熱情的用色,從點描派吸收了綿密與理智。 這 是巴黎蒙馬特附近的小公園, 他用點描派技法, 繪著公園裡濃情的戀人們