unable to register (com.google.iid error 1005.)

前端 未结 1 1273
面向向阳花
面向向阳花 2021-01-24 04:33

I\'m attempting to integrate GCM into our iOS app. I\'ve followed the instructions to update our project for GCM to no avail. Everything I try to register I get:



        
相关标签:
1条回答
  • 2021-01-24 04:54

    As usual as soon as I post a question to SO, the answer leaps out at me.

    The routine:

    [[GCMService sharedInstance] startWithConfig:[GCMConfig defaultConfig]];
    

    which I knew I was calling in:

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

    right before

    [[UIApplication sharedApplication] registerUserNotificationSettings:notificationSettings];
            [[UIApplication sharedApplication] registerForRemoteNotifications];
    

    was needed in two locations... I missed that. Once I added it just before the call:

    [[GGLInstanceID sharedInstance] tokenWithAuthorizedEntity:_gcmSenderID
                                                        scope:kGGLInstanceIDScopeGCM
                                                      options:_registrationOptions
                                                      handler:_registrationHandler];
    

    in:

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

    everything started working. Delightful...

    0 讨论(0)
提交回复
热议问题