I am testing the APNS message feature in QuickBlox. I used the sample code and using the single user option whereby I created a user ("pushuser") and password and added the authentication criteria in the code in appdelegate.m as directed by the QuickBlox instructions (see the code included). The app compiles fine and when first loaded onto my iPhone, I got the pop-up about allowing push notifications for the app. I check the iPhone settings in the Notifications area and see that the app is in their and allowed to send notifications. When I go to the QuickBlox Admin Panel and try to send a test Simple push notification. I get the error at the top of the Admin Panel "No recipients. At least one user should be subscribed for APNS (Apple Push) (through SDK or REST API)". My QuikBlox ApplicationID, AuthorizationKey and AuthorizationSecret are all included correctly since I am able to do other things with the app that require these. Any help is appreciated. Thanks!
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions
{
// Set QuickBlox credentials (You must create application in admin.quickblox.com)
[QBSettings setApplicationID:xxxx];
[QBSettings setAuthorizationKey:@"xxxxxx"];
[QBSettings setAuthorizationSecret:@"xxxxxx"];
[QBAuth createSessionWithDelegate:self];
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Show Splash
self.splashController = [[[SplashController alloc] initWithNibName:@"SplashViewController" bundle:nil] autorelease];
self.window.rootViewController = (UIViewController*)self.splashController;
[self.window makeKeyAndVisible];
return YES;
QBASessionCreationRequest *extendedAuthRequest =[QBASessionCreationRequest request];
extendedAuthRequest.userLogin = @"pushuser";
extendedAuthRequest.userPassword = @"pushuserpwd";
[QBAuth createSessionWithExtendedRequest:extendedAuthRequest delegate:self];
}
#pragma mark -
#pragma mark QBActionStatusDelegate
// QuickBlox queries delegate
- (void)completedWithResult:(Result *)result{
if(result.success) {
// Create session result
if([result isKindOfClass:QBAAuthSessionCreationResult.class]){
// You have successfully created the session
// Subscribe Users to Push Notifications
[QBMessages TRegisterSubscriptionWithDelegate:self];
// Subscribe User to Push Notifications result
}else if([result isKindOfClass:QBMRegisterSubscriptionTaskResult.class]){
// Now you can receive Push Notifications!
}
}else{
NSLog(@"errors=%@", result.errors);
}
}