drc15469 2015-09-22 22:26
浏览 165
已采纳

使用AWS SNS将推送通知发送到特定的APNS令牌

I'm trying to send a basic APNS push notification to a specific APNS token using AWS SNS. All the examples I'm finding are how to store the token in SNS, subscribe to channels, and publish to channels.

I don't need that kind of usage with the application I'm building. The golang application decides which users a push needs to be sent to for which actions. Then it looks up the tokens for those users in the DB. All I need is a basic request to send a push notification to that token (preferably asynchronously).

Here is one of the examples I've looked at: http://docs.aws.amazon.com/sdk-for-go/api/service/sns/SNS.html#Publish-instance_method

  • 写回答

1条回答 默认 最新

  • donglao4370 2015-09-23 08:53
    关注

    To use the Publish action for sending a message to a mobile endpoint, such as an app on a Kindle device or mobile phone, you must specify the EndpointArn. The EndpointArn is returned when making a call with the CreatePlatformEndpoint action.

    The easiest way of getting the EndpointArn would be to store it along with or instead of the APNS token in your DB, assuming you are using CreatePlatformEndpoint. Otherwise have a look at this question: Amazon SNS: How to get EndpointArn by token(registrationId) using amazon .net sdk?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?