标签: apn

iOS 15 应用程序未收到静默推送通知(=后台通知)

我被困了好几天了,需要你的帮助。

\n

我想接收静默推送通知(又称后台通知)来更新我的应用程序内容。

\n

AppDelegate 中的以下部分不会被调用。

\n
func 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代码。服务器端说向设备发送通知成功,所以我认为问题出在前端。

\n
def 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 …

apn apple-push-notifications swift

8
推荐指数
0
解决办法
2254
查看次数

苹果服务不能用apns创建3个关键服务

我是苹果开发人员的新手.我为我的应用程序创建apns密钥时遇到问题(之前有2个密钥服务).

这是我的捕捉屏幕 在此输入图像描述

经过大量的搜索,我仍然不知道为什么?我读了苹果文档说只使用apn键使ios应用程序可以获得远程通知.其他关键不起作用.请帮帮我.谢谢.

apn apple-push-notifications

7
推荐指数
1
解决办法
3892
查看次数

使用代码创建网络访问点名称,

我想通过代码创建APN,Android SDK中是否有任何支持,我已经尝试了很多但没有成功,我找到了一些与此相关的信息http://blogs.msdn.com/b/zhengpei/archive/2009/ 10/13/managing-apn-data-in-google-android.aspx我使用这个引用创建了一个类,但是无法做任何事情,可以请给出解决方案吗???? 谢谢

android gprs apn 3g

6
推荐指数
1
解决办法
2万
查看次数

是否可以在android中以编程方式切换APN?

我正在尝试开发一个应用程序,我需要以编程方式连接到特定的APN以进行网络测试.

作为用户,我可以通过转到"设置" - >"无线和网络" - >"移动网络"(长按) - >"接入点名称"来完成此操作.它甚至会让我手动添加一个新的.

我想知道,有一种应用程序可以自动执行此操作的方式吗?我有root权限和你可能需要的一切.

如果有人知道android源码,你能指点我去哪里研究这个屏幕的行为吗?我试图在那里潜水,但我有点失落.

android apn android-source android-wireless

6
推荐指数
1
解决办法
7543
查看次数

错误:消息/注册令牌未注册

有人会问为什么当我尝试向 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

消息传递/注册令牌未注册:

提供的注册令牌未注册。以前有效的注册令牌可能会因多种原因而被取消注册,包括:

  • 客户端应用程序已从 FCM 取消注册
  • 客户端应用程序自动取消注册。(如果用户卸载应用程序,或者在 iOS 上,如果 APNS 反馈服务报告 APNS 令牌无效,则可能会发生这种情况。)
  • 注册令牌已过期。(例如,Google 可能决定刷新注册令牌,或者 iOS 设备的 APNS 令牌可能已过期。)
  • 客户端应用程序已更新,但新版本未配置为接收消息。

对于所有这些情况,请删除此注册令牌并停止使用它发送消息。

但我觉得我已经满足了所有要求(APNS …

apn apple-push-notifications ios flutter firebase-cloud-messaging

6
推荐指数
0
解决办法
6143
查看次数

添加 APN 时运营商应用抛出 SecurityException

我们有一个具有运营商特权的 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)

privileges android telecommunication apn euiccmanager

6
推荐指数
0
解决办法
337
查看次数

iOS 推送通知不适用于开发证书

情况:我们在不同的后端 URL 上安装了 PROD 和 DEV APN 证书。生产证书有效!:推送已交付。

DEV 证书不起作用,苹果服务器返回错误代码 7(无效令牌)。我已经检查了所有的东西,但可能我仍然遗漏了一些东西。

  • app id 是正确的(同样用于 prod)
  • 我使用正确的后端(安装了 DEV 证书)
  • 我在DEBUG模式下从XCode启动应用程序(对应DEV环境)
  • 我使用来自同一个帐户的适当的应用程序开发证书
  • 我使用正确的开发配置文件(支持推送)

应该真的有用吧?

profile certificate apn push-notification ios

5
推荐指数
1
解决办法
4782
查看次数

PushSharp Apns通知错误:'ConnectionError'

我正在使用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)

apn push-notification ios asp.net-mvc-4 pushsharp

5
推荐指数
1
解决办法
3485
查看次数

Apple 推送通知/Ruby OpenSSL 错误

当尝试从我的 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)

这个错误信息非常模糊,无法弄清楚发生了什么。

ruby openssl ruby-on-rails apn

5
推荐指数
1
解决办法
2145
查看次数

如何根据网络提供商自动设置 APN?

当新的 SIM 卡(从未使用过)插入新的智能手机(从未使用过)时,智能手机似乎无需任何手动设置即可设置正确的 APN。是否存在与 APN <-> 网络运营商关联的全局表(智能手机内)?

注意:使用AT命令查询新SIM卡似乎有首选网络运营商,但内存中没有保存APN。

apn sim-card

5
推荐指数
1
解决办法
1万
查看次数