Skip to content

Location support library for Engage Digital Messaging Android SDK

Notifications You must be signed in to change notification settings

ringcentral/engage-digital-messaging-android-location

Repository files navigation

Engage Digital Messaging Maps SDK for Android

Engage Digital Messaging Maps SDK for Android is a plug-in for the Engage Digital Messaging Android SDK. It allows your users to send location messages through you Engage Digital Messaging channel using Google APIs.

Supported Versions

The Engage Digital Messaging Maps SDK for Android is currently supporting Android 5.0 (API 21) and above and is only compatible with the Engage Digital Messaging Android SDK version 2.3.0 and above.

Please note that the Engage Digital Messaging Maps SDK for Android will require the usage of AndroidX

Getting Started

Before going through any of the following step please make sure that you have a working implementation of the Engage Digital Messaging Android SDK.

Follow these steps to install/initialize the Engage Digital Messaging Maps SDK for Android:

  1. Installation using gradle
  2. Google API keys
  3. Initialize the Engage Digital Messaging Maps SDK
  4. Customize the Engage Digital Messaging Maps SDK appearance

Install the Engage Digital Messaging Maps SDK for Android using Gradle

Add these to your Grade file:

Repositories

repositories {
    maven {
        url "https://raw.github.com/ringcentral/engage-digital-messaging-android-location/master"
    }
}

Dependencies

dependencies {
    implementation 'com.ringcentral.edmessagingmapssdk:edmessagingmapssdk:1.0.0'
}

API keys

The Engage Digital Messaging Maps SDK for Android takes advantage of the Google APIs to provide maps capabilities to the Engage Digital Messaging Android SDK and thus requires the usage of Google API keys.

Key Restriction(s) Purpose(s)
Android key Maps SDK for Android Used to display the map.
Maps key Places API Used to enable the address search.

Engage Digital Messaging Maps initialization

  1. Add your Android key (see API keys) to your application's manifest (please bear in mind that the Engage Digital Messaging Android SDK won't show the location button if this API key is not present):
<application
  <meta-data android:name="com.google.android.geo.API_KEY" android:value="YOUR_API_KEY" />
</application>
  1. Initialize the EngageDigitalMessagingMaps singleton instance:
EngageDigitalMessagingMaps engageDigitalMessagingMaps = EngageDigitalMessagingMaps.getInstance();
  1. (OPTIONAL) Set your Maps key (the search button won't be displayed if this API key is not present):
engageDigitalMessagingMaps.setMapsApiKey("YOUR_MAPS_KEY");
  1. Override the onLocationButtonClick on your DimeloListener:
Dimelo dimelo = Dimelo.getInstance();
Dimelo.DimeloListener dimeloListener = new Dimelo.DimeloListener() {
    ...
    @Override
    public void onLocationButtonClick(Chat chat) {
        super.onLocationButtonClick(chat);
        engageDigitalMessagingMaps.build(MainActivity.this);
        engageDigitalMessagingMaps.setMapsListener(new EngageDigitalMessagingMaps.EngageDigitalMessagingMapsListener() {
            @Override
            public void sendLocationMessage(Intent data) {
                super.sendLocationMessage(data);
                Dimelo.getInstance().sendLocationMessage(data, chat);
            }
        });
    }
};

Customizing the Engage Digital Messaging Maps SDK Appearance

See how to customize the Engage Digital Messaging Maps SDK appearance using the Android Resource folders.

About

Location support library for Engage Digital Messaging Android SDK

Resources

Stars

Watchers

Forks

Packages

No packages published