1

実際のデバイスでデバイストークンを生成中に問題が発生しています。 デバイスをデバッグしていて、デバイストークンが生成されていません。 場合によっては動作しないことがあります。デバイストークンがiOSを生成しない

問題が発生する可能性があることをお知らせください。 ありがとう

+0

時々動作しますが、時々そうではありません:同じデバイスでですか?さまざまなデバイス?さまざまなiOSバージョン?エラーコールバックが呼び出されていますか? – Larme

+0

同じ事を二度聞くのは良い習慣だとは思わない。どちらの質問でも、詳細、コード、iOSのバージョンなどを提供していないため、研究努力はしていません。あなたの質問の1つを削除し、問題の詳細をあなたが保持している質問に含めることを強くお勧めします。乾杯! –

答えて

0

@GopalDevraあなたはもっと明確になりますか?とにかく、私はパースのためのこのコードを持っています、多分あなたのケースではないが、あなたはそのアイデアを得ることができます。

あなたが好きなAppDelegate.mでdidRegisterForRemoteNotificationsWithDeviceTokenを使用することができます。

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { 

    // Store the deviceToken in the current installation and save it to Parse. 
    PFInstallation *currentInstallation = [PFInstallation currentInstallation]; 
    [currentInstallation setDeviceTokenFromData:deviceToken]; 
    currentInstallation.channels = @[ @"global" ]; 
    [currentInstallation saveInBackground]; 
} 

編集

あなたはdidFinishLaunchingWithOptionsでこれを入れていますか?

+0

ありがとうございました 私はこれらのコード行を試しました。 しかし、動作していません –

+0

@GopalDevra私の答えを更新しました。見てみな。 –

+0

@ J.Lopes今日、サンドボックスAPNからデバイストークンを取得できますか? –

1

didFinishLaunchingWithOptionsAppDelegate.mにしましたか?

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) 
{ 
    NSLog(@"ios8 app"); 
    [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]]; 
    [[UIApplication sharedApplication] registerForRemoteNotifications]; 
} 
else 
{ 
    NSLog(@"lower ios8 app"); 
    [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)]; 
} 
0

あなたはトークンが生成されていない理由の答えを、取得します。この方法で、

func application(application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError) 
    { 
     print("application:didFailToRegisterForRemoteNotificationsWithError: %@", error) 
    } 

を追加します。

+0

目的のc :-(void)アプリケーションの編集:(UIApplication *)アプリケーションdidFailToRegisterForRemoteNotificationsWithError:(NSError *)エラー{ } –

1

現在、私もデバイストークンの取得に問題があります。

私のプロジェクトは、10時間ほど前に「消去」と「インストール」されたときにデバイストークンの生成を停止しました。 韓国のiOSデベロッパーフォーラムでも、過去10時間以内に発生していないAPNSトークンの問題を報告している人がいます。

サンドボックスAPNSサーバーの一部に問題がある可能性があります。ノーデバイストークン、プッシュ通知が届かない:

  • 最終時間 2016年4月27日22:43 PM 0900 GMTを確認しました。
+0

これは本当に起こっている@CheeseLemonですか? –

+0

はい、今は誰もが今すぐ報告しています。 – CheeseLemon

関連する問題