Android 的 Amazon Pinpoint - 在开发工具包 jar 文件中找不到 AWSMobileClient
Amazon Pinpoint for Android - AWSMobileClient not found in the SDK jar file
我试图实施一个简单的示例 Android 应用程序来说明如何集成 Amazon Pinpoint - 针对移动应用程序的推送通知。所以我正在阅读并遵循下面的文档进行集成:
Initializing the Amazon Pinpoint Client - Amazon Pinpoint
然后我发现SDK jar文件里面没有找到AWSMobileClient
。 (其他 类,例如 PinpointManager
或 CognitoCachingCredentialsProvider
可用。)如果您导入并阅读了用于接收 Amazon Pinpoint 测试推送通知的示例 Android 项目,您可能有注意到这个 AWSMobileClient
在 com.amazonaws.mobile
包里。
我想知道我是否遗漏了什么,这是有意为之并在其他地方记录的,等等。
我添加了以下罐子:
aws-android-sdk-core-2.3.5.jar
aws-android-sdk-pinpoint-2.3.5.jar
和认知依赖:
compile 'com.amazonaws:aws-android-sdk-cognito:2.3.5'
(注册和处理令牌需要AWSMobileClient
,请参阅this了解更多信息。)
我找到了doc中的句子:
In the following example, the AWSMobileClient class is provided in the AWS Mobile Hub sample code to reference the Amazon Pinpoint object.
所以看起来 AWSMobileClient
不是 SDK 的一部分,而是为示例项目定义的。
[更新]
如果您在 Mobile Hub 上完成添加您的应用程序并准备集成 SDK,您将看到 Android Setup Steps
部分,其中还显示,
Copy the Mobile Hub Helper and Custom Code
Copy the contents of the java/com/amazonaws folder from the helper code you downloaded into the java/com folder of your Android Studio project.
This folder contains a set of helper classes that have been custom generated for you. These were generated based on your project configuration and on the AWS cloud resources and identifiers that were created for you when you configured the project. These classes simplify the use of all the SDKs that are required to support your project.
或者,您可以在应用的 build.gradle
中添加此依赖项
compile ('com.amazonaws:aws-android-sdk-mobile-client:2.6.+@aar') { transitive = true; }
我发现
implementation ('com.amazonaws:aws-android-sdk-mobile-client:2.+@aar') { transitive = true }
在以下两个选项无效时有效:
compile ('com.amazonaws:aws-android-sdk-mobile-client:2.6.+@aar') { transitive = true; }
和
implementation ('com.amazonaws:aws-android-sdk-mobile-client:2.6.+@aar') { transitive = true; }
我试图实施一个简单的示例 Android 应用程序来说明如何集成 Amazon Pinpoint - 针对移动应用程序的推送通知。所以我正在阅读并遵循下面的文档进行集成:
Initializing the Amazon Pinpoint Client - Amazon Pinpoint
然后我发现SDK jar文件里面没有找到AWSMobileClient
。 (其他 类,例如 PinpointManager
或 CognitoCachingCredentialsProvider
可用。)如果您导入并阅读了用于接收 Amazon Pinpoint 测试推送通知的示例 Android 项目,您可能有注意到这个 AWSMobileClient
在 com.amazonaws.mobile
包里。
我想知道我是否遗漏了什么,这是有意为之并在其他地方记录的,等等。
我添加了以下罐子:
aws-android-sdk-core-2.3.5.jar
aws-android-sdk-pinpoint-2.3.5.jar
和认知依赖:
compile 'com.amazonaws:aws-android-sdk-cognito:2.3.5'
(注册和处理令牌需要AWSMobileClient
,请参阅this了解更多信息。)
我找到了doc中的句子:
In the following example, the AWSMobileClient class is provided in the AWS Mobile Hub sample code to reference the Amazon Pinpoint object.
所以看起来 AWSMobileClient
不是 SDK 的一部分,而是为示例项目定义的。
[更新]
如果您在 Mobile Hub 上完成添加您的应用程序并准备集成 SDK,您将看到 Android Setup Steps
部分,其中还显示,
Copy the Mobile Hub Helper and Custom Code Copy the contents of the java/com/amazonaws folder from the helper code you downloaded into the java/com folder of your Android Studio project.
This folder contains a set of helper classes that have been custom generated for you. These were generated based on your project configuration and on the AWS cloud resources and identifiers that were created for you when you configured the project. These classes simplify the use of all the SDKs that are required to support your project.
或者,您可以在应用的 build.gradle
中添加此依赖项compile ('com.amazonaws:aws-android-sdk-mobile-client:2.6.+@aar') { transitive = true; }
我发现
implementation ('com.amazonaws:aws-android-sdk-mobile-client:2.+@aar') { transitive = true }
在以下两个选项无效时有效:
compile ('com.amazonaws:aws-android-sdk-mobile-client:2.6.+@aar') { transitive = true; }
和
implementation ('com.amazonaws:aws-android-sdk-mobile-client:2.6.+@aar') { transitive = true; }