0

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);
        }
    }
bachma0507
  • 1,543
  • 2
  • 11
  • 22
  • How did you solved this issue ? as I am facing same issue ! – Maulik Jan 01 '14 at 07:10
  • @Maulik, I actually used another APN provider since this was driving me crazy. The other provider was relatively easy to setup and I've had no issues so far. I can't even recall posting this issue with quickblox..lol – bachma0507 Jan 03 '14 at 12:44

1 Answers1

0

one thing which i would ask you to try is to check log

are there any errors?

NSLog(@"errors=%@", result.errors);

Because this query [QBMessages TRegisterSubscriptionWithDelegate:self]; can return errors and your subscription to push notifications won't be success. For example it can be unsuccess in you are using invalid provision profile.

Thanks

Maulik
  • 19,348
  • 14
  • 82
  • 137
Rubycon
  • 18,156
  • 10
  • 49
  • 70
  • I am getting `Current application doesn't have appropriate credentials to send notifications over APNS (Apple Push)` I've already follow http://quickblox.com/developers/How_to_create_APNS_certificates – Maulik Jan 01 '14 at 07:11
  • You should upload APNS certificates (p12 or pem) to QuickBlox Admin panel – Rubycon Jan 01 '14 at 18:46
  • 1
    did you subscribe at least one user to the Apple pushes? Also you can write email to assist@quickblox.com - team will help you to resolve this issue direct – Rubycon Jan 02 '14 at 10:33