Search code examples
iospush-notificationapple-push-notificationschatquickblox

Quickblox push notification failed


I am using Quickblox for chating application. Working on push notification for chat. I have uploaded APNs development certificate to Quickblox. I have done subscription via code and it shows my device in Quickblox admin section. But when i am trying to send push notification via admin panel, the push notification is not coming. I am choosing "Testing" environment and "IOS" channel and it shows:

"Success Apns channel. Notification has been successfully added to queue."

But notification wont come on device. In a queue section it shows:

APNS (Apple Push) Delivered: 0, failed: 1
Download detailed log
Event log
2016-03-21 06:50:34 UTC : queued 1 notifications

In detailed log it shows:

{"notification":{"aps":{"alert":"msg","sound":"default"}},"log":[{"device_token":"my token","created_at":"2016-03-23T04:48:04Z","delivered_at":null,"failed_at":"2016-03-23T04:48:51Z","error_code":8,"error_description":"Invalid token (8)"}]}

To register I am using this code :

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
    NSString *deviceIdentifier = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
    [QBRequest registerSubscriptionForDeviceToken:deviceToken uniqueDeviceIdentifier:deviceIdentifier
                                     successBlock:^(QBResponse *response, NSArray *subscriptions)
    {
        NSLog(@"Successfully Registered......");
    }
                                       errorBlock:^(QBError *error)
    {
        NSLog(@"Error ------> %@", error);
                                     }];
}

And It shows "Successfully Registered......" And I can see it in admin section also. Help me please..


Solution

  • Created new P12 certificate again with the new key and new development certificate. Then I got push notifications.