我被困了好几天了,需要你的帮助。
\n我想接收静默推送通知(又称后台通知)来更新我的应用程序内容。
\nAppDelegate 中的以下部分不会被调用。
\nfunc application(_ application: UIApplication,\n didReceiveRemoteNotification userInfo: [AnyHashable: Any],\n fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult)\n -> Void) {\n \n if let messageID = userInfo[gcmMessageIDKey] {\n print("Message ID: \\(messageID)") // Does not get printed\n }\n\n print("success") // Does not get printed\n\n completionHandler(UIBackgroundFetchResult.newData)\n \n}\n
Run Code Online (Sandbox Code Playgroud)\n下面是服务器端的Python代码。服务器端说向设备发送通知成功,所以我认为问题出在前端。
\ndef send_notifications_to_fcm_token(fcm_token):\n try:\n message = messaging.Message(\n apns=messaging.APNSConfig(\n headers={\n 'apns-push-type': 'background',\n 'apns-priority': '5',\n },\n payload=messaging.APNSPayload(\n aps=messaging.Aps(content_available=True)\n ),\n ),\n token=fcm_token,\n )\n response = messaging.send(message)\n except:\n response = False\n return response\n
Run Code Online (Sandbox Code Playgroud)\n一些附加说明。
\n …我是苹果开发人员的新手.我为我的应用程序创建apns密钥时遇到问题(之前有2个密钥服务).
经过大量的搜索,我仍然不知道为什么?我读了苹果文档说只使用apn键使ios应用程序可以获得远程通知.其他关键不起作用.请帮帮我.谢谢.
我想通过代码创建APN,Android SDK中是否有任何支持,我已经尝试了很多但没有成功,我找到了一些与此相关的信息http://blogs.msdn.com/b/zhengpei/archive/2009/ 10/13/managing-apn-data-in-google-android.aspx我使用这个引用创建了一个类,但是无法做任何事情,可以请给出解决方案吗???? 谢谢
我正在尝试开发一个应用程序,我需要以编程方式连接到特定的APN以进行网络测试.
作为用户,我可以通过转到"设置" - >"无线和网络" - >"移动网络"(长按) - >"接入点名称"来完成此操作.它甚至会让我手动添加一个新的.
我想知道,有一种应用程序可以自动执行此操作的方式吗?我有root权限和你可能需要的一切.
如果有人知道android源码,你能指点我去哪里研究这个屏幕的行为吗?我试图在那里潜水,但我有点失落.
有人会问为什么当我尝试向 Iphone 物理设备发送通知时出现此错误吗?
Error sending message { Error: Requested entity was not found.
at FirebaseMessagingError.FirebaseError [as constructor] (/srv/node_modules/firebase-admin/lib/utils/error.js:42:28)
at FirebaseMessagingError.PrefixedFirebaseError [as constructor] (/srv/node_modules/firebase-admin/lib/utils/error.js:88:28)
at new FirebaseMessagingError (/srv/node_modules/firebase-admin/lib/utils/error.js:254:16)
at Function.FirebaseMessagingError.fromServerError (/srv/node_modules/firebase-admin/lib/utils/error.js:287:16)
at Object.createFirebaseError (/srv/node_modules/firebase-admin/lib/messaging/messaging-errors.js:34:47)
at /srv/node_modules/firebase-admin/lib/messaging/messaging-api-request.js:76:42
at <anonymous>
at process._tickDomainCallback (internal/process/next_tick.js:229:7)
errorInfo:
{ code: 'messaging/registration-token-not-registered',
message: 'Requested entity was not found.' },
codePrefix: 'messaging' }
Run Code Online (Sandbox Code Playgroud)
它说我的注册令牌未注册。查看 firebase 文档后,我看到: https ://firebase.google.com/docs/cloud-messaging/send-message#admin_sdk_error_reference
消息传递/注册令牌未注册:
提供的注册令牌未注册。以前有效的注册令牌可能会因多种原因而被取消注册,包括:
对于所有这些情况,请删除此注册令牌并停止使用它发送消息。
但我觉得我已经满足了所有要求(APNS …
apn apple-push-notifications ios flutter firebase-cloud-messaging
我们有一个具有运营商特权的 eUICC,我们可以通过以下方式检查特权
telephonyManager.hasCarrierPrivileges()
它返回true。
Android 文档说我们可以使用 Content Provider API 来添加、修改 APN。
但我们仍然无法添加 APN。堆栈跟踪
java.lang.SecurityException: No permission to access APN settings
at com.android.providers.telephony.TelephonyProvider.checkPermission(TelephonyProvider.java:7029)
at com.android.providers.telephony.TelephonyProvider.insertSingleRow(TelephonyProvider.java:5948) ```
Run Code Online (Sandbox Code Playgroud) 情况:我们在不同的后端 URL 上安装了 PROD 和 DEV APN 证书。生产证书有效!:推送已交付。
DEV 证书不起作用,苹果服务器返回错误代码 7(无效令牌)。我已经检查了所有的东西,但可能我仍然遗漏了一些东西。
应该真的有用吧?
我正在使用PushSharp 4.0.10,MVC 4和c#
在Apns代理的OnNotificationFailed事件中,我得到了ConnectionError异常.
更改证书(.p12)文件后突然发生此异常; 在这次改变之前它运作良好.
请告知如何解决此错误.
var certificate = System.IO.File.ReadAllBytes(System.Web.Hosting.HostingEnvironment.MapPath("~/Content/Mobile/consumer_dev.p12"));
var config = new ApnsConfiguration(ApnsConfiguration.ApnsServerEnvironment.Sandbox, certificate, "", true);
var apnsBroker = new ApnsServiceBroker(config);
apnsBroker.OnNotificationFailed += (notification, aggregateEx) => {
aggregateEx.Handle (ex => {
if (ex is ApnsNotificationException) {
var notificationException = (ApnsNotificationException)ex;
var apnsNotification = notificationException.Notification;
var statusCode = notificationException.ErrorStatusCode;
Debug.WriteLine(apnsNotification.Identifier + ", " + statusCode);
} else {
Debug.WriteLine(ex.InnerException);
}
return true;
});
};
apnsBroker.OnNotificationSucceeded += (notification) => {
Debug.WriteLine("Apple Notification Sent!");
};
apnsBroker.Start();
foreach (var deviceToken in …
Run Code Online (Sandbox Code Playgroud) 当尝试从我的 Rails 应用程序发送推送通知时,我收到了此消息。我确保设备令牌和 .pem 文件对于命令有效
openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert aps_development.pem -key aps_development.pem
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read finished A: tlsv1 alert internal error
from /Library/Ruby/Gems/2.0.0/gems/houston-2.2.3/lib/houston/connection.rb:44:in `connect'
from /Library/Ruby/Gems/2.0.0/gems/houston-2.2.3/lib/houston/connection.rb:44:in `open'
from /Library/Ruby/Gems/2.0.0/gems/houston-2.2.3/lib/houston/connection.rb:19:in `open'
from /Library/Ruby/Gems/2.0.0/gems/houston-2.2.3/lib/houston/client.rb:40:in `push'
Run Code Online (Sandbox Code Playgroud)
这个错误信息非常模糊,无法弄清楚发生了什么。
当新的 SIM 卡(从未使用过)插入新的智能手机(从未使用过)时,智能手机似乎无需任何手动设置即可设置正确的 APN。是否存在与 APN <-> 网络运营商关联的全局表(智能手机内)?
注意:使用AT命令查询新SIM卡似乎有首选网络运营商,但内存中没有保存APN。
apn ×10
android ×3
ios ×3
3g ×1
certificate ×1
euiccmanager ×1
flutter ×1
gprs ×1
openssl ×1
privileges ×1
profile ×1
pushsharp ×1
ruby ×1
sim-card ×1
swift ×1