Setup a Mobile application
-
Sign in to the Amazon developer console.
-
Click the
, and then select Android or iOS as the channel of integration.
-
Enter the required information to generate an API Key.
-
Add the API Key to your project.
Add the API key to an Android project
-
Right-click the assets folder within the Project View in Android Studio.
-
Select New and then choose File.
-
If the assets folder doesn’t exist, create it by right-clicking the project's parent directory, selecting New, then Folder, and naming it Assets Folder.
-
Name the new file as
api_key.txt
. -
Open the
api_key.txt
file in the editor window provided. -
Add your specific API Key to this text file.
-
Go to the File menu and click Save.
Common Errors
Error | Resolution |
---|---|
SDK throws an API key error |
|
ERROR_ACCESS_DENIED | Ensure that no unintended characters like Byte Order Marks are added to the api_key.txt file. Remove any extra spaces, line feeds, or suspicious characters that might cause connectivity errors. If needed, obtain a new API key to troubleshoot persistent issues. |
Add the API key to an iOS project
-
Open your project and navigate to the Supporting Files folder.
-
Select the
<project>-Info.plist
file (where<project>
is your project’s name) to open the property list for editing.Ensure that no entries are selected.
-
From the main menu, click Editor, and then Add Item.
-
Create a key with the name APIKey and press Enter.
-
Double-click under the Value column and paste the generated API Key as a value for the APIKey key.
Common Errors
Error | Resolution |
---|---|
SDK throws an API key error | Ensure that you are using the right bundle identifier. |