user3734535
user3734535

Reputation: 1

Device Token didn't receive

I'm getting this alert message while getting device token by using this code.

"Error Domain=NSCocoaErrorDomainCode=3000"no valid aps-environment'entitlement string found for application" Userinfo=0x1665f5b0 {NSlocalizedDescription=no valid 'app-environment'entitlement string found for application}

- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)var_deviceToken
{

    NSString *tokenString = [[deviceToken description] stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<>"]];
    NSLog(@"Push Notification tokenstring is %@",tokenString);
    self.deviceToken = tokenString;


 }

 - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
 {

     NSString* s=[[NSString alloc] initWithFormat:@"%@",error];
     UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"Device Token didn't recieve" message:s delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
     [alert show];

 }

Upvotes: 0

Views: 95

Answers (1)

sunil
sunil

Reputation: 300

The reasons for getting this issue is ,

  1. You didn't enable the push notification in your provisional profile .
  2. If enabled ,you may forget of using that bundle identifier and mobile provision .

Upvotes: 1

Related Questions