【问题标题】:AWS amazon android firebase push notificationAWS 亚马逊 android firebase 推送通知
【发布时间】:2017-07-17 13:08:39
【问题描述】:

我在使用 Firebase 实现 Android AWS Amazon 推送通知时遇到问题,在 Amazon 示例中,它显示您添加这行代码

link

AWSMobileClient.defaultMobileClient().getPinpointManager().getNotificationClient().registerGCMDeviceToken(refreshedToken);

但是一旦你将它添加到项目中AWSMobileClient 类没有初始化所以我已经添加了这些SDK

compile 'com.amazonaws:aws-android-sdk-core:2.4.5'
compile 'com.amazonaws:aws-android-sdk-cognito:2.4.5'
compile 'com.amazonaws:aws-android-sdk-pinpoint:2.4.5'
compile 'com.amazonaws:aws-android-sdk-mobileanalytics:2.4.5'

但是他们没有初始化,搜索后发现你必须添加示例所以我添加了它 Sample classes 但是类没有初始化。

那么有没有简单的例子来初始化这个谢谢。

【问题讨论】:

    标签: android amazon-web-services firebase notifications amazon


    【解决方案1】:

    希望这会有所帮助。您需要填写:

    • IDENTITY_POOL_ID
    • APP_ID
    • 将 Regions.US_EAST_1 调整为您使用的任何区域。

    代码:

    CognitoCachingCredentialsProvider cognitoCachingCredentialsProvider = new CognitoCachingCredentialsProvider(context,"IDENTITY_POOL_ID",Regions.US_EAST_1);
    
    PinpointConfiguration config = new PinpointConfiguration(context, "APP_ID", Regions.US_EAST_1, cognitoCachingCredentialsProvider);
    
    PinpointManager pinpointManager = new PinpointManager(config);
    
    pinpointManager.getNotificationClient().registerGCMDeviceToken(refreshedToken);
    

    【讨论】:

      猜你喜欢
      • 2017-09-05
      • 1970-01-01
      • 2017-11-14
      • 2021-09-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多