【问题标题】:Getting push to work with adhoc builds推动使用临时构建
【发布时间】:2014-02-22 12:32:47
【问题描述】:

我正在关注此处设置 iOS 推送的教程:

Here - Ray Wenderlich

它适用于开发版本,即使用开发者证书处于调试模式的应用程序。我可以使用提供的 simplepush.php 脚本向单个设备发送消息。

我无法让它与 adhoc 构建一起使用 - 这是使用分发证书构建的。

我需要在 simplepush.php 中进行哪些更改才能使其适用于临时构建?

我将 gateway.sandbox.push.apple.com:2195 更改为 gateway.push.apple.com:2195 因为我认为沙箱应该用于开发/debug 构建,adhoc 和 appstore 构建应该使用 gateway.push.apple.com:2195。

我收到此响应,但没有消息传递到设备令牌指定的设备。

连接到 APNS 消息成功发送

【问题讨论】:

    标签: ios apple-push-notifications


    【解决方案1】:

    请注意device token-ID

    这对于开发和生产环境是不同的。

    - (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
    
           UIAlertView *alert= [[UIAlertView alloc]initWithTitle: deviceToken message:Nil delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
            [alert show];
    }
    

    【讨论】:

    • 谢谢会尝试。我不知道它们是不同的,所以我仍在使用相同的开发设备令牌。
    • 100% 不同。即使设置已连接并发送,也意味着设备未知。更改令牌 ID。你会搞定的
    • 感谢它的工作。在时间允许的情况下,我会接受你的回答。
    猜你喜欢
    • 1970-01-01
    • 2012-03-25
    • 2011-07-14
    • 2011-04-26
    • 1970-01-01
    • 2017-09-22
    • 2016-03-13
    • 2013-03-07
    • 2021-06-26
    相关资源
    最近更新 更多