Does push notification not work?

I edit and change the training profile many times. and I also checked it in a text editor. everything is ok with the preparation profile. but still push notifications do not work. and I get this error. everyone says its bcz with a poor training profile, but my profiled profile values ​​are the same as Apple, their documentation says. I m get this error:

Error registering. Error: Domain error = NSCocoaErrorDomain Code = 3000 "no valid" aps-environment "permission string found for application" UserInfo = 0x127d80 {NSLocalizedDescription = no valid access string "aps-environment" found for application}

the code looks 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

+3
1

, "no valid" aps-environment " , " , . , Mahesh). , , push-.

+7

Source: https://habr.com/ru/post/1792764/


All Articles