推送通知不工作? [英] Push Notification is not working?

查看:143
本文介绍了推送通知不工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的编辑和修改的次数发放模板很多。我在文本编辑器检查它。一切都确定了供应曲线。但还是推送通知不工作。而我会收到此错误。每个人都在说,它的坏BCZ调配配置文件,但我的provisioning profile值是相同的苹果在其文档中说。 I M收到此错误:

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:

错误登记。错误:错误域= NSCocoaErrorDomain
  code = 3000没有有效的APS-环境的权利字符串发现
  申请的UserInfo = {0x127d80 = NSLocalizedDescription没有有效
  发现应用程序的APS-环境的权利字符串}

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像这样在我的AppDelegate.m:

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

推荐答案

我相信发现应用程序没有有效的APS-环境的权利字符串当你不使用正确的配置配置文件登录您的应用程序出现错误。你必须为您的应用程序的配置文件中描述的 马赫什的链接)。另外请注意,你不能用一个团队的provisioning profile签署需要推送通知的应用程序。

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.

这篇关于推送通知不工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆