Introduction
...
Info | |||||||
---|---|---|---|---|---|---|---|
| |||||||
If you choose to use Google Play Services, you need to know the following :
|
...
If prompted with an error, add this "Import" command to enable Appoxee SDK usage:
Code Block language java linenumbers true import com.appoxee.Appoxee;
Inbox integration - after enabling the Inbox in your Appoxee account (by going to the app's Application Information page and checking Allow Inbox + Rich messages), add the Inbox to your code as follows:
Note The Inbox feature guarantees your ability to engage the user with rich messages (note that the Inbox cannot be disabled by users, as opposed to Push Notifications) and gives you the option to access features such as Feedback and More Apps . The Inbox must be used in your application's code in order to show it and utilize its features. The InboxMessage activity needs to be added in order to support Push Notifications by Appoxee. Check your Manifest.xml and see that it is added below the Receiver declaration.
Add code that opens the Inbox - the Inbox can be opened from any activity. In the example code below, the Inbox is opened from the main activity layout, using the "openInbox():" function:
Code Block language java linenumbers true public void openInbox(View view) { Intent intent = new Intent(this, Inbox.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); this.startActivity(intent); }
Add a button that opens the Inbox - it is recommended to add a button to open the Inbox. This button is added in the activity layout as follows:
Code Block language xml linenumbers true <Button android:id="@+id/open_inbox" android:layout_width="match_parent" android:layout_height="wrap_content" android:onClick="openInbox" android:text="Open Appoxee Inbox" />
Show the number of unread messages - to show the user the number of unread messages, fetch this number using the following command:
Code Block language java linenumbers true Appoxee.getUnreadMessages();
Deep Link / URL Scheme in Appoxee & Android
Add to your AndroidManifest.xml
Code Block language xml linenumbers true <activity android:name="com.appoxee.example.DeepLinkActivity" > <!-- Add the Intent Filter for activity needed to be URLScheme compatible --> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="example" android:host="pushnotification" /> </intent-filter> </activity>
Create DeepLinkActivity.java
Code Block language java title DeepLink Activity Sample linenumbers true //This sample extends AppoxeeBaseActivity, for onStart() & onStop() integration and analytics public class DeepLinkActivity extends AppoxeeBaseActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intent = getIntent(); if (intent == null || intent.getData() == null) { finish(); } openDeepLink(intent.getData()); // Finish this activity finish(); } public void openDeepLink(Uri deepLink) { String path = deepLink.getPath(); Utils.Debug("Base path: " + path); //Implement your Code here path = path.replace("/", ""); Intent intent = new Intent(); intent.setClassName(this, path); this.startActivity(intent); } .....
NEXT STEP: Step 4 of the Appoxee Android SDK IntegrationYou are now done integrating the Appoxee SDK! Congrats!
1. If you wish to use the SDK Sync API's - press here
2. If you wish to use the SDK Async API's - press here
3. If you wish to use the Custom Push Notification Builder - press here
As mentioned earlier, our Test Application contains a full code sample. it can be downloaded from here.