rohan panchal
rohan panchal

Reputation: 881

iPhone:don't receive push notification using urban airship

I am using push notification using urban airship in my application using the documentation

I write the code as follows

NSMutableDictionary *takeOffOptions = [[[NSMutableDictionary alloc] init] autorelease];
[takeOffOptions setValue:launchOptions forKey:UAirshipTakeOffOptionsLaunchOptionsKey];
 

[UAirship takeOff:takeOffOptions];

[[UIApplication sharedApplication]
 registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
                                     UIRemoteNotificationTypeSound |
                                     UIRemoteNotificationTypeAlert)];

but I receive following error log in my console.

did Fail To Register For Remote Notifications With Error: Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0xce2a310

I twice checked documentation and implement the code

On the site of urban airship it shows msg that "no device token found" then what should be the problem.

Upvotes: 1

Views: 1049

Answers (2)

Lithu T.V
Lithu T.V

Reputation: 20021

aps-environment is the key value which is appearing in your provisioning profile.To hav this key in this profile ur profile must be registered for push notification service.

Use development credentials for development server and production credentials for production server.

To do : delete your provision profile from the xcode and download a new one from developer site which is configured.

Upvotes: 0

Devang
Devang

Reputation: 11338

Try the below steps :

The problem is indeed the provisioning profile -- this is iOS reporting it, so there's no way around it. Here's my suggestion:

  1. Delete the app and provisioning profile on the device.
  2. Sync with iTunes, to make sure it's fully removed
  3. Delete the provisioning profile from Xcode.
  4. Restart Xcode
  5. Re-generate and re-download the provisioning profile from the iOS Provisioning Profile.
  6. Open the profile in a text editor to make sure it has the 'aps-environment' present
  7. Load the profile into Xcode, and set the Code Signing Identity to use the right profile.

That should make sure Xcode loads the right profile and installs the app; I've seen it fail silently, so being thorough is your best bet.

You can search more about this at where I found above solution : https://support.urbanairship.com/customer/portal/questions/13141-push-error-failure-to-register-on-iphone

Upvotes: 1

Related Questions