简体   繁体   English

AWS Amazon Android Firebase推送通知

[英]AWS amazon android firebase push notification

I have an issue with implementing Android AWS Amazon push notification using firebase, in Amazon sample, it shows you to add this line of code 我在使用firebase实施Android AWS Amazon push push通知时遇到问题,在Amazon示例中,它显示了添加此行代码

link 链接

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

But once you add it to the project AWSMobileClient class not initialized so I have added these SDK's 但是,一旦将其添加到未初始化的项目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'

But they didn't initialize, after searching I found that you have to add the sample so I added it Sample classes but the classes didn't initialize. 但是他们没有初始化,在搜索之后,我发现您必须添加示例,因此我将其添加为Sample类,但是这些类没有初始化。

So is there any straightforward example to Initializing this thank you. 因此,有没有直接的示例可以初始化此谢谢。

Hopefully this helps. 希望这会有所帮助。 You'll need to fill in: 您需要填写:

  • IDENTITY_POOL_ID IDENTITY_POOL_ID
  • APP_ID APP_ID
  • Adjust Regions.US_EAST_1 to whichever region you are using. 将Regions.US_EAST_1调整为您正在使用的任何区域。

Code: 码:

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);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM