Skip to content

Instantly share code, notes, and snippets.

@rafaellincoln
Last active December 15, 2017 01:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaellincoln/c3dea82d727ca76e8c750298c3af5d15 to your computer and use it in GitHub Desktop.
Save rafaellincoln/c3dea82d727ca76e8c750298c3af5d15 to your computer and use it in GitHub Desktop.

1 - Criar uma pasta chamada libs e colocar o sdk da IBM e o Plugin do inbox (jar), que se encontra na pasta plugins do repositorio, dentro dela

2 - Adicionar o comando abaixo na dependencies do build.grandle do app.
compile fileTree(include: ['*.jar'], dir: 'libs')

3 - Adicionar configuração no AndroidManifest.xml

<!--IBM PUSH-->
<provider
    android:name="com.ibm.mce.sdk.db.Provider"
    android:authorities="${applicationId}.MCE_PROVIDER"
    android:exported="false" />
<receiver android:name="com.ibm.mce.sdk.gcm.GcmBroadcastReceiver" >
    <intent-filter android:permission="com.google.android.c2dm.permission.SEND" >
        <action android:name="com.google.android.c2dm.intent.RECEIVE" />
        <category android:name="${applicationId}" />
    </intent-filter>
    <intent-filter android:permission="com.google.android.c2dm.permission.SEND" >
        <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
        <category android:name="${applicationId}" />
    </intent-filter>
</receiver>

<receiver android:name="com.ibm.mce.sdk.notification.NotifActionReceiver" />
<receiver android:name="com.ibm.mce.sdk.wi.AlarmReceiver" >
    <intent-filter>
        <action android:name="android.intent.action.BOOT_COMPLETED" />
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.TIMEZONE_CHANGED" />
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.LOCALE_CHANGED" />
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.PACKAGE_REPLACED" />
        <data android:scheme="package" />
    </intent-filter>
</receiver>

<service android:name="com.ibm.mce.sdk.gcm.GcmIntentService" />
<service android:name="com.ibm.mce.sdk.events.EventsAlarmListener" />
<service android:name="com.ibm.mce.sdk.attributes.AttributesQueueConsumer" />
<service android:name="com.ibm.mce.sdk.registration.RegistrationIntentService" />
<service android:name="com.ibm.mce.sdk.registration.PhoneHomeIntentService" />
<service android:name="com.ibm.mce.sdk.session.SessionTrackingIntentService"  />
<service android:name="com.ibm.mce.sdk.plugin.inbox.InboxUpdateService" />
<service android:name="com.ibm.mce.sdk.location.LocationRetrieveService" />
<service android:name="com.ibm.mce.sdk.location.GeofenceIntentService" />
<service android:name="com.ibm.mce.sdk.location.LocationEventsIntentService" />
<service android:name="com.ibm.mce.sdk.location.LocationSyncAlarmListener" />
<receiver android:name="com.ibm.mce.sdk.location.LocationUpdateCaller" />

<activity
    android:name="com.ibm.mce.sdk.plugin.inbox.RichInboxActivity" android:configChanges="orientation" >
</activity>

<activity
    android:name="com.ibm.mce.sdk.plugin.inbox.InboxMessageDisplayActivity" android:configChanges="orientation" >
</activity>
<!--FIM IBM PUSH-->

4 - Adicionar extends MceApplication no MainApplication.

5 - Adicionar push.png na pasta res/drawable. Que será o icone exibido na notificação.

6 - Adicionar o código abaixo, no onCreate() do MainApplication, para inicializar o icone.

int icon = getResources().getIdentifier("push", "drawable", getPackageName());
MceSdk.getNotificationsClient().getNotificationsPreference().setIcon(getApplicationContext(), icon);

7 - extrair a res do plugin do inbox para dentro da res do aplicativo.

8 - Descomentar linhas do arquivo AlgarTelecomModule.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment