Reputation: 3301
We are working on an IOS application, we want to implement PUSH NOTIFICATION, I have gone through apple documentation, and asked my Team agent to enable the Push Notification in iOS dev center, they did it seems, its enabled now. I have registered in my application for Push notification like below...
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
When I ran the application, didFailToRegisterForRemoteNotificationsWithError got called, I was not able to predict the problem, Is there anything else I can do with certification.
thanks...
Upvotes: 3
Views: 21411
Reputation: 3815
For push Notification
What you need to do is, First open the provisioning portal and then go to App IDs section.
Find your app and then there are two options for configuring the Push Notification, one for Development and another for production.
If your app is under testing and development, use development and configure that and in return you will get the certificate. which will be placed on the server who will send push notifications.
Next, then you need to regenerate the provisioning profiles,
Go to the provisioning profiles and modify them and then re-download. You will get Push Notification Enabled Provisioning profiles.
Don't forget to implement this method in the AppDelegate of your project (APP):
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{
}
Build your project with the new profile and you are good to go.
For more help check this tutorial.
Even after you've enabled your app id for push, it might take a couple of hours for it to work.
Upvotes: 15
Reputation: 11588
If you are getting this message:
no valid 'aps-environment' entitlement string found for application
in the NSError
that is passed to -[UIApplication application:didFailToRegisterForRemoteNotificationsWithError:]
, you may need to check that you're using the correct provisioning profile, and that it is the one that is Push Notification-enabled. See these posts for some pointers:
Upvotes: 3
Reputation: 2745
Just go to your applications. Then configure it for "Push Notification".
Configure & Enable it for Development Push SSL Certificate.
Then download latest certificate for application.
Thanks.
Upvotes: 1