@jugarrit jugarrit released this Aug 18, 2016 · 75 commits to master since this release

Assets 2

Nougat Ready!

Google made some changes to the Android SDK in Nougat that cause Smooch to crash due to file permissions issues.
This issue has been resolved, and Smooch can now safely be built to target Nougat devices.

Nougat

Firebase Cloud Messaging

Since Google has encouraged migrating from GCM to FCM, we've taken the opportunity to do so for Smooch as well.

In order to migrate from GCM to FCM, follow the instructions below:

Step 1. Remove unneccessary GCM configuration and generate a new google-services.json

  1. In your project level build.gradle file, update the google-services version to the following:

    classpath 'com.google.gms:google-services:3.0.0'
  2. Remove unnecessary permissions from your AndroidManifest.xml file

    <permission
        android:name="io.smooch.shellapp.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />
    
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="io.smooch.shellapp.permission.C2D_MESSAGE" />
  3. Remove the GCM Receiver

    <receiver
        android:name="com.google.android.gms.gcm.GcmReceiver"
        android:exported="true"
        android:permission="com.google.android.c2dm.permission.SEND" >
        <intent-filter>
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            <category android:name="<your_package>" />
        </intent-filter>
    </receiver>
  4. Import your existing Google project in the Firebase console.

  5. Once imported, click on the app settings and go to 'Manage'

  6. Download the google-services.json file and replace the existing one in your Android project

Step 2. Configure push notifications in Smooch

  1. Go to https://app.smooch.io and log into your account.
  2. On the Overview page, select Android
  3. Back in the Firebase console, go to the "Cloud Messaging" menu and copy your Server API Key and Sender ID into Smooch.

That's it!
Clean and rebuild your Android project, and you should have push notifications working correctly.

Get User Properties

Properties for the current user are now exposed via getters on the Smooch User object.
For example, to retrieve the current user's first name simply call the following:

Smooch.getCurrentUser().getFirstName();

OkHttp3

Until now, Smooch was using OkHttp version 2.4.0. This has now been updated to 3.4.1.

API changes

Core

  1. Class User.
    • Added new method getEmail
    • Added new method getFirstName
    • Added new method getLastName
    • Added new method getSignedUpAt
    • Added new method getProperties
    • Added new method getUserId
    • Added new method getSmoochId
  2. Class GcmService.
    • Changed name to FcmService
    • Renamed method triggerSmoochGcm to triggerSmoochNotification