我正在尝试使用以下命令测试我的服务器和Apple的沙盒APNS服务器之间的连接:
$ openssl s_client -connect gateway.sandbox.apple.com:2195 -cert cert.pem -key key.pem
Enter pass phrase for key.pem:
gethostbyname failure
connect:errno=0
Run Code Online (Sandbox Code Playgroud)
是什么意思gethostbyname failure,原因是什么?
在同一台服务器上,telnet到端口2195工作正常:
$ telnet gateway.push.apple.com 2195
Trying 17.149.36.242...
Connected to gateway.push-apple.com.akadns.net.
Escape character is '^]'.
Run Code Online (Sandbox Code Playgroud)
更新:如果我使用IP而不是主机名,它工作正常:
$ openssl s_client -connect 17.149.36.242:2195 -cert cert.pem -key key.pem
Run Code Online (Sandbox Code Playgroud)
OpenSSL无法解析DNS?
我们可以通过任何方式实现这一目标,只需要一个基本的方法,不需要代码或类似的东西,但需要一些概念性的指导.
步骤#1用户走进Shop ABC所在的特定位置
步骤#2在那个特定的时刻,某种设备(iBeacon,Raspberry PI或类似的东西)认识到这个特定的iPhone设备非常接近,并且它向第三方服务器发送一些HTTP请求并提供一些信息.
步骤#3第三方服务器向设备发送通知,告知它应该下载ABC商店的应用程序
或Raspberry PI或iBeacon识别设备接近度并直接向iPhone设备发送相同的通知,而无需联系第三方服务器.
我在测试时向APNS注册了自己.我能够获取我的设备令牌application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
但是,如何取消注册自己,以便系统再次提示我接收推送通知?
已尝试删除该应用并重置Reset Location & Privacy.
我只是想知道Local Notification我的应用程序是否可以使用而不是Push Notification.
我的应用程序通过服务器的API从我的服务器获取数据.这是一个适合足球运动员的小型社交网络.我希望应用程序在用户的朋友在用户所在的城市发布游戏时通知用户.
应用程序是否可以运行后台进程来轮询服务器以获取城市中的新拾取游戏,例如每10-15分钟,当有新的拾取游戏时,它会向设备发送通知?
notifications objective-c apple-push-notifications ios uilocalnotification
我正在构建一个应用程序来处理从Parse推送的通知,并尝试创建通知历史记录功能.我已经成功启用了后台模式,因此当应用程序在后台运行时,应用程序可以很好地获得有效负载,application:didReceiveRemoteNotification:fetchCompletionHandler甚至不会点击横幅/警报.但是,当强制退出/向上滑动以杀死应用程序时,application:didReceiveRemoteNotification:fetchCompletionHandler不会被调用.
在没有点击横幅/警报的情况下杀死应用程序时,是否有任何方法可以实现获取推送通知有效负载?先感谢您!
我试图在我们的构建服务器上为我的应用程序生成一个新的APNs证书,但是当我进入证书和私钥的"导出2项"步骤时,我发现我没有两个项目.我的证书没有任何私钥.
我可以在我的钥匙串中看到证书属于系统钥匙串,而公钥和私钥都在我的CI-Jenkins钥匙串中.
我在我的开发机器上重复了这个过程,它在那里工作得很好.
唯一的区别是构建服务器当前设置为使用我们的自定义CI-Jenkins钥匙串而不是默认登录钥匙串.
谁知道那里发生了什么,是否有意义?在生成证书之前是否需要交换钥匙串,然后在构建服务器上交换回来?
我正在创建一个具有聊天功能的Apple Watch应用程序.我想在手表应用程序运行并收到APNS消息时更新聊天对话.我知道AppDelegate,功能
application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject])
Run Code Online (Sandbox Code Playgroud)
可以使用,但这只是在设备应用程序在前台运行而不是在后台运行时.在WKUserNotificationInterfaceController,有功能didReceiveRemoteNotification,但仅在使用动态通知时使用.是否可以让监视应用程序处理在不使用动态通知并且在前台运行时收到的远程通知?
push-notification apple-push-notifications ios swift watchkit
我有一些问题,设置一个控制台应用程序,将推送通知发送到iOS/Android设备.
错误显示如下:
Unhandled Exception: System.AggregateException: One or more errors
occurred. ---System.UnauthorizedAccessException: The remote server
returned an error: (401)
Unauthorized..TrackingId:ea158550-8761-41f8-821d-dbcb88fcce56,TimeStamp:18/07/2016
08:58:21 ---System.Net.WebException: The remote server returned an
error: (401) Unauthorized. at
System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at
Microsoft.Azure.NotificationHubs.NotificationRequestAsyncResult`1.<GetAsyncSteps>b__3(TAsyncResult
thisPtr, IAsyncResult r) at
Microsoft.Azure.NotificationHubs.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult
result) --- End of inner exception stack trace ---
Server stack trace:
Exception rethrown at [0]: at
Microsoft.Azure.NotificationHubs.Common.AsyncResult.End[TAsyncResult](IAsyncResult
result) at
Microsoft.Azure.NotificationHubs.NotificationHubManager.EndSendNotification(IAsyncResult
result) at
System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult
iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean
requiresSynchronization) --- End of inner exception stack trace --- …Run Code Online (Sandbox Code Playgroud) c# azure apple-push-notifications google-cloud-messaging azure-notificationhub
我已经设置推送通知并在appdelegate中工作,但是一旦应用程序打开,我就不会让它们启动,我希望它们在用户注册应用程序后在单独的"允许推送通知"视图控制器上启动.我尝试appDelegate通过这样做来引用:
let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
Run Code Online (Sandbox Code Playgroud)
我有一个registerForPushNotifications功能appDelegate:
func registerForPushNotifications(application: UIApplication) {
let notificationSettings = UIUserNotificationSettings(forTypes: [.Badge, .Sound, .Alert], categories: nil)
application.registerUserNotificationSettings(notificationSettings)
}
Run Code Online (Sandbox Code Playgroud)
从didFinishLaunchingWithOptions函数内部调用时有效,AppDelegate但是当我尝试在我的视图控制器上调用该函数时,我没有任何东西可以传递给函数的应用程序部分,所以我最终得到一个错误.
@IBAction func yesButtonPressed(sender: AnyObject) {
appDelegate.registerForPushNotifications(application)
performSegueWithIdentifier("pushToHomeSegue", sender: self)
}
Run Code Online (Sandbox Code Playgroud) push-notification apple-push-notifications ios appdelegate swift
我需要用于静默通知的通知有效负载示例,我在下面的结构中尝试了此方法,但是它不起作用
{
"notification" : {
"body" : " Survey list updated",
"content-available:" : true,
"data" : {
"isNewUpdateAvailable" : "easysurvey.survey_list_updated"
}
},
"to" : "f6PwToRUxk0:APA91bG7bSWoKsjHXVmXaiDEnFXA2x2jEOMSO6eGCqPv1fRd-dctNLDEabRq-0So_obuPGFqOFTSLJl5FFyuOuXKBXh-n89BmzzXenRTxoirY9Y1c6-J9MxpDp0ojHL2xm1law0V6gg3"
}
Run Code Online (Sandbox Code Playgroud)
使用此结构,我可以接收通知,但它不是静音的,不会唤醒应用程序。我需要Firebase通知的解决方案,并且在iOS 10上,我遵循的是相同的Firebase示例代码
apple-push-notifications ios firebase firebase-cloud-messaging ios10
ios ×9
swift ×2
appdelegate ×1
azure ×1
c# ×1
firebase ×1
ibeacon ×1
ios10 ×1
iphone ×1
keychain ×1
objective-c ×1
openssl ×1
private-key ×1
raspberry-pi ×1
watchkit ×1
xcode ×1