iOSの最近の記事

objective-C文字列の比較は==ではダメ
kemworldさんから

NSString *hoge1 = @"piyo";
NSString *hoge2 = @"piyo";

if ([hoge1 isEqualToString:hoge2]) {
	//ようやくこっちに判定!!
} else {
	//
}

OpenCV

| コメント(0)

Amazon Web Services: SNS

| コメント(0)

Amazon Web Services: SNS


AWS SNSを使うと比較的に簡単にプッシュ通知を実現できるんだけど、通知と同時に音をならしたり、バッジを設定しようとすると、JSON形式でメッセージを送る必要がある。
デフォルト音は以下の引用を参考にするとだせるが、あとは、バッジの数の設定例がまだよくわからない。

以下引用です。

JSON Publish 例

  1. {
  2. "default": "<enter your message here>",
  3. "email": "<enter your message here>",
  4. "sqs": "<enter your message here>",
  5. "http": "<enter your message here>",
  6. "https": "<enter your message here>",
  7. "sms": "<enter your message here>",
  8. "APNS": "{\"aps\":{\"alert\": \"<message>\",\"sound\":\"default\"} }",
  9. "APNS_SANDBOX": "{\"aps\":{\"alert\": \"<message>\",\"sound\":\"default\"} }",
  10. "GCM": "{ \"data\": { \"message\": \"<message>\" } }",
  11. "ADM": "{ \"data\": { \"message\": \"<message>\" } }"
  12. }

APNS だと sound が使える。

Lancorkさんから。http://www.lancork.net

追記(2014/11/04)
registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later.

iOS8よりregisterForRemoteNotificationTypesが使えなくなった。
ターゲットがiOS7でも動作しないため、iOSのバージョンを判定した上で対応する必要あり。

    /* iOS8より、registerForRemoteNotificationTypesは、使えない。

    [[UIApplication sharedApplication]registerForRemoteNotificationTypes:

     (UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];

     return YES;

    */

    

    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)

    {

        [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];

        [[UIApplication sharedApplication] registerForRemoteNotifications];

    }

    else

    {

        [[UIApplication sharedApplication] registerForRemoteNotificationTypes:

         (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];

    }

    return YES;




http://dev-ipho.blogspot.jp/2013/02/iphone.html

「iPhoneアプリ開発 苦闘の道」さんより。
http://www.objectivec-iphone.com/foundation/NSString/intValue.html

逆引きObjective-C for iPhoneアプリさんから。
http://www.objectivec-iphone.com/foundation/NSString/rangeOfString.html


逆引きObjective-C for iPhoneアプリさんから。
http://www.objectivec-iphone.com/foundation/NSFileManager/fileExistsAtPath.html

逆引きObjective-C for iPhoneアプリさんから。

このアーカイブについて

このページには、過去に書かれた記事のうちiOSカテゴリに属しているものが含まれています。

前のカテゴリはWebToolsです。

次のカテゴリはrubyです。

最近のコンテンツはインデックスページで見られます。過去に書かれたものはアーカイブのページで見られます。