Skip to content

Latest commit

 

History

History
61 lines (41 loc) · 1.26 KB

README.md

File metadata and controls

61 lines (41 loc) · 1.26 KB

Hey, the awesome guys at Intercom released an official cordova plugin. Use that instead!

cordova-intercom

Install

$ cordova plugin add co.asku.cordova.intercom --variable API_KEY="ios_sdk-0000..." --variable APP_ID="zz..."

JS API

All functions are on the cordova.plugins.intercom object.

startSession

Starts the user's session using their unique identifier (either or email or id).

cordova.plugins.intercom.startSession({ id: 1 });
// OR
cordova.plugins.intercom.startSession({ email: '[email protected]' });

openMessages

Opens the Intercom messages list UI.

cordova.plugins.intercom.openMessages();

updateAttributes

Updates the user properties for this user in Intercom.

cordova.plugins.intercom.updateAttributes({
  name: 'Josh',
  favorite_pizza: 'pepperoni'
});

logEvent

Sends a user interaction event to Intercom.

cordova.plugins.intercom.logEvent('ate-pizza', {
  flavor: 'cheese'
});

checkForUnreadMessages

Tell Intercom to look for unread messages and present them to the user, overlayed on the web content. It's recommended to call this between each page view.

cordova.plugins.intercom.checkForUnreadMessages();