Reputation: 4914
I can send push notification to an IOS device (IOS 5.1 IPAD 3rd gen) and handle notifications etc.. So it works quite well.
Now I have to use another device(IOS 5.1 IPAD 3rd gen), on organizer by right clicking I add my device to provisioning profile I can install my app to device but I can not send push notifications because I can not get device's token.
I guess it is because when I right click and add device to my provisioning profile It only adds the iOS Team Provisioning Profile
rather then myApp Development Profile
On apples developer portal I have:
On My Organizer In Library-->Provisioning Profiles
On my teams
And I handle error code on push Notification:
- (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
{
NSLog(@"Failed to get token, error: %@", error);
}
Error Is: Failed to get token, error: Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0xxxxxxx {NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}
In case error is because provisioning profile:
How can add that Paper Developement profile to my device? or How can I learn device token and send push notification without creating provisioning profile all over?
Thanks in advance
Upvotes: 1
Views: 2659
Reputation: 1218
For me it was just changing the bundle identifier and code signing identity to IOS Developer. The bundle identifier Changing it back and forth and building between changes did the trick (not sure if this step necessary). Not sure what it really was. Hope this helps someone someday, probably not.
Upvotes: 0
Reputation: 1553
I had similar issues before so I will list your possible issues,
Firstly do not use a provisioning profile with a wild card it is highly possible that your IOS Team Provisoning Profile
includes a wild card. So just go to your device's provisioning profile on organizer and delete that IOS Team Provisoning Profile
Secondly go to your provisoning profiles on developer.apple and click edit as on your second picture in question. When you click edit you will see Modify click on that
and add your device by checking squares like below:
Click save and download new profile, now go to your provisioning profiles on your organizer and delete previous Pape Developement Profile
. Double click your downloaded profile or click refresh on your organizer. Now drag and drop proviosinig profile to your device on organizer.
Finally if none of above solves your problem that means probably your bundle identifier and your app id does not much in this case check this answer
Hope you solve this issue....
Upvotes: 1