3

i edit and modify the provisioning profile alot of times. and i checked it in text editor too. everything is ok with provisioning profile. but still push notifications are not working. and i m getting this error. everyone is saying that its bcz of bad provisioning profile but my provisioning profile values are the same as Apple said in their documentation. i m getting this error:

Error in registration. Error: Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0x127d80 {NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}

code lookes like this in my AppDelegate.m:

    - (BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions {
                  [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |                       UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
                  [self.window addSubview:navigationController.view];
                  [self.window makeKeyAndVisible];
                  return YES;
       }
    -(void)application:(UIApplication )application didRegisterForRemoteNotificationsWithDeviceToken:(NSData )deviceToken {
                 NSString *deviceTokenStr = [[[[deviceToken description] stringByReplacingOccurrencesOfString: @"<" withString: @""] stringByReplacingOccurrencesOfString: @">" withString: @""] stringByReplacingOccurrencesOfString: @" " withString: @""];
                 NSLog(@"DeviceTokenStr: %@",deviceTokenStr);
       }

Thanx for help in advance

Srikar Appalaraju
  • 71,928
  • 54
  • 216
  • 264
Piscean
  • 3,069
  • 12
  • 47
  • 96
  • I found this useful link: http://mobiforge.com/developing/story/programming-apple-push-notification-services – Mahesh Feb 17 '11 at 10:57

1 Answers1

7

I believe the "no valid 'aps-environment' entitlement string found for application" error appears when you don't sign your app with the correct provisioning profile. You'll have to generate a profile for your app as described in Mahesh's link). Also note that you can't use a team provisioning profile to sign an app that requires push notifications.

rubenvb
  • 74,642
  • 33
  • 187
  • 332
Jon Nadal
  • 729
  • 9
  • 14