iOS推送通知应用程序不要求注册许可 [英] iOS push notification app not asking for permission on registration

查看:65
本文介绍了iOS推送通知应用程序不要求注册许可的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个需要启用推送通知的应用程序.我遵循了文章,并且在我下载了配置文件之前一切正常.我正在使用Rubymotion开发此应用,因此在我的Rakefile中,我做到了,

I am working on an app which requires push notifications to be enabled. I have followed this article and worked fine till I downloaded the provisioning profile. I am using Rubymotion to develop this app and hence in my Rakefile I Did this,

app.name = 'Myapp'
app.identifier = 'com.myapp.development'
app.provisioning_profile = '/Users/sunilkumar/Library/MobileDevice/Provisioning Profiles/Myapp_Development.mobileprovision'

我的应用"是我的应用的名称.标识符是项目标识符(根据Rubymotion文档以及我认为的捆绑标识符),我将其默认值覆盖以使其与我在IOS开发中心中创建的应用程序ID相同.

'My App' is the name of my app. Identifier is the project identifier (as per the Rubymotion docs and as per my belief thats the bundle identifier ), the default value of which I override to make it same as the App Id which I created in the IOS development center.

在我的app_delegate.rb中,我也有这段代码

In my app_delegate.rb, I also have this piece of code,

UIApplication.sharedApplication.registerForRemoteNotificationTypes(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)

问题在于,当连接设备并安装应用程序时,不会询问推送通知的权限.我想我所做的几乎所有事情都正确,并且按照我上面链接的文章所述,但是以某种方式看来似乎行不通.在这方面的任何帮助将不胜感激.

The issue is that when the device is connected and the app installed, the permission for push notifications is not being asked. I guess I have done almost everything right and is as per the article I linked above, but somehow it just doesn't seem to work. Any help on this would be must appreciated.

推荐答案

弄清楚了.

我必须在RubyMotion项目的Rakefile中设置aps环境.

I had to set the aps-environment in my RubyMotion project's Rakefile.

app.entitlements['aps-environment'] = 'development'  
app.entitlements['get-task-allow'] = true

一经发现,它就对我有效.谢谢大家的答复.

As soon as I did, it worked for me. Thanks all for the responses.

这篇关于iOS推送通知应用程序不要求注册许可的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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