我们完全被困,请帮忙.
我和我的团队制作了一个iPhone应用程序,这是我们第一次尝试使用iOS.
一切都很好,直到我们提交我们的应用程序并在app-store上可用 - 推送通知服务无效.我在网上搜索并尝试通过人们的建议仔细检查我们的应用程序,但我找不到有什么问题.所以这个问题发布在这里.
这些是我们做的:
我们构建应用程序,假设它名为"AppMaster".
我们在iOS Provisioning Portal上创建了名为"pushtest"的AppId.此ID在开发和生产上启用了推送通知.
我们从上面的appId创建了一个名为"AppMasterPushTest"的Provisioning for development.这个配置用于内部测试,团队中的每个人都将其安装在他们的mac上.
我们的服务器由Java实现,我们使用java-apn包.在测试过程中,我们下载了用于开发的认证文件并写出了.p12文件,并通过使用包的api - withSandboxDestination()和.p12文件将我们的消息推送到"沙盒"服务器.测试顺利,收到通知.
我认为我们已经准备好了,所以我们创建了另一个名为"AppMaster"的AppId,并仅为生产启用推送通知.此ID写在应用程序的包标识符中.
我们在步骤5中从AppId进行了另一个名为"appMaster"的生产配置,将分发方法设置为"App Store".下载并重建应用程序.这个被提交给苹果,并在app-stroe上活跃起来.
服务器端,我们下载了生产认证并再次写出.p12文件.并使程序通过使用api - withProductionDestination()将消息推送到生产服务器,并且.p12刚写出来.
我们从App Store安装了该应用程序.遗憾的是,通知从未发出.
我们错过了什么吗?顺便说一句,我们在step5中创建的id看起来像"XXX.com.company.appname",但在应用程序的bundle标识符中,我们只设置了"com.company.appname"部分,没有前缀.这可能是问题吗?
欢迎任何想法.
请成为我们的救星.谢谢.
有没有办法使用google的firebase发送静音APNS?似乎如果应用程序在后台,它将始终向用户显示通知.
谢谢?
push-notification apple-push-notifications firebase silentpush firebase-cloud-messaging
这是我第一次在我的App中使用推送通知.我已经通过示例应用程序和书籍,我得到了如何将推送通知发送到单个设备.但我没有得到我应该在我的程序中做什么更改向多个设备发送推送通知.我正在使用"PushMeBaby"应用程序进行服务器端编码.拜托,帮帮我吧.提前致谢.
我有推送通知的问题.我有一个由团队成员创建的p.12证书,我有设备令牌,可以将设备推送到.我正在使用javapns库来执行推送(也尝试了相同结果的javaapns lib)但我一直收到此错误:
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:136)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1720)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:954)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1138)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:632)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:59)
at java.io.OutputStream.write(OutputStream.java:58)
at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:402)
at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:350)
at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:320)
at javapns.Push.sendPayload(Push.java:177)
at javapns.Push.combined(Push.java:100)
at PushTest.push(PushTest.java:43)
at PushTest.main(PushTest.java:25)
Run Code Online (Sandbox Code Playgroud)
这是我用来测试的代码
try {
List<PushedNotification> n = Push.combined(text, 20, null, file, "********", false, token);
for (PushedNotification notification : n) {
if (notification.isSuccessful())
System.out.println("Push notification sent successfully to: " + notification.getDevice().getToken());
else {
String invalidToken = notification.getDevice().getToken();
Exception theProblem = notification.getException();
theProblem.printStackTrace();
ResponsePacket theErrorResponse = …Run Code Online (Sandbox Code Playgroud) application:didReceiveRemoteNotification:fetchCompletionHandler当应用程序强行退出时,似乎不会调用该函数.我的印象是,无论应用程序处于什么状态,都会调用该函数,但似乎只有在应用程序已在后台运行时才会调用它.有没有办法在后台唤醒应用程序,如果它尚未使用新的iOS 7远程通知后台模式运行?
我在iOS9中收到两次相同的推送通知,虽然它在iOS8中工作正常.
我使用以下代码注册推送通知:
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
if ([application respondsToSelector:@selector(registerUserNotificationSettings:)])
{
// use registerUserNotificationSettings
UIUserNotificationSettings *setting = [UIUserNotificationSettings settingsForTypes:( UIUserNotificationTypeSound | UIUserNotificationTypeAlert|UIUserNotificationTypeBadge) categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:setting];
[[UIApplication sharedApplication] registerForRemoteNotifications];
}
else
{
// use registerForRemoteNotifications
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert |UIRemoteNotificationTypeBadge)];
}
#else
// use registerForRemoteNotifications
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
#endif
Run Code Online (Sandbox Code Playgroud) 我正在使用RMSPushNotificationsBundle来处理推送通知.我正在从一台服务器向多个应用程序发送pushNotifications.我正在使用选择正确证书的setAPNSPemAsString方法.但推送通知仅在第一次发送.谁能告诉我为什么?谢谢!
public function sendIOS($appName){
$notifications = $this->container->get('rms_push_notifications');
$message = new iOSMessage();
$message->setMessage($this->message);
$message->setData($this->getData());
$message->setAPSSound("default");
$message->setDeviceIdentifier($this->pushToken);
if ($appName !="appName") {
$pemFile = $this->container->getParameter("rms_push_notifications.ios.".$appName.".pem");
$passphrase = $this->container->getParameter("rms_push_notifications.ios.".$appName.".passphrase");
$pemContent = file_get_contents($pemFile);
$notifications->setAPNSPemAsString($pemContent, $passphrase);
}
return $notifications->send($message);
}
Run Code Online (Sandbox Code Playgroud) 有点不到一年前,一个团队成员现在已经在应用商店中建立了一个iphone应用程序,还有一个ios推送通知守护进程,它发送通知.今天,守护进程开始吐出SSL证书错误 - 似乎守护进程的证书已经过期.
我已经获得了开发者帐户的用户名和密码,并且我已登录到配置门户以创建新证书.如果我去管理我们不再支持的旧应用的应用ID,我会看到:

但是,如果我管理我正在尝试更新的应用程序ID,我会看到:

为什么我没有选择为此应用程序生成新的推送SSL证书?没有它,如何更新推送守护程序的ssl证书?
我们需要重建并重新提交应用吗?
我创建了一个应用程序来从Web服务器发送远程通知.当我在开发模式下测试应用程序时,所有通知都在手机上正确到达,在AppStore发布后,应用程序不再收到通知.
这就是我做的:
这是我测试的:
以下是我在Xcode上签署应用的方式:

这是发送通知的php页面的代码:
$ctx = stream_context_create();
//stream_context_set_option($ctx, 'ssl', 'passphrase', 'development_pwd');
//stream_context_set_option($ctx, 'ssl', 'local_cert', 'ck_development.pem');
//$fp = stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx); //test
stream_context_set_option($ctx, 'ssl', 'passphrase', 'production_pwd');
stream_context_set_option($ctx, 'ssl', 'local_cert', 'ck_production.pem');
$fp = stream_socket_client('ssl://gateway.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx); //production
echo "<p>Connection Open</p>";
if(!$fp){
echo "<p>Failed to connect!<br />Error Number: " . $err . " <br />Code: …Run Code Online (Sandbox Code Playgroud) 我正在尝试iOS平台的Google Cloud Messaging示例应用.https://developers.google.com/cloud-messaging/ios/start
要生成GoogleServices-Info.plist,需要APNS开发和生产证书(PKCS#12文件格式).我在MAC KeyChain Access中创建了.p12文件(捆绑了APNS开发证书和私钥).
但是在上传.p12文件时,它表示它的格式不正确(证书必须是有效的PKCS12文件).
ios ×5
iphone ×4
objective-c ×2
certificate ×1
firebase ×1
ios7 ×1
java ×1
php ×1
pkcs#12 ×1
push ×1
silentpush ×1
symfony ×1
xcode ×1