GithubHelp home page GithubHelp logo

intercome.xamarin.android's Introduction

Intercom.Xamarin

Introduction

Xamarin Binding for Intercom 7.2.0. The Intercom SDK enables you to use the Intercom Messenger in your app, have conversations with your customers, send rich outbound messages, show your Help Center, and track events.

Installation

Intercom packages

Intercom.Xamarin.Android

Intercom.Xamarin.iOS

Intercom.Xamarin.Forms

Step 1 - Add refernces to Intercom

If you’re new to Intercom, you’ll need to create an account and start your free trial.

Android

Permissions

We include the INTERNET permission by default as we need it to make network requests:

<uses-permission android:name="android.permission.INTERNET"/>

You will need to include the READ_EXTERNAL_STORAGE permission if you have enabled image attachments:

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

You can also include VIBRATE to enable vibration in push notifications:

<uses-permission android:name="android.permission.VIBRATE"/>

iOS

Update Info.plist

Photo Library usage: Add a "Privacy - Photo Library Usage Description" entry to your Info.plist.

This is required by Apple for all apps that access the photo library. It is necessary when installing Intercom due to the image upload functionality. Users will be prompted for the photo library permission only when they tap the image upload button.

Step 2 - Initialize Intercom

First, you'll need to get your Intercom app ID and Android API key. To find these, just select the 'Intercom for Android/iOS' option in your app settings.

Android

Then, initialize Intercom by calling the following in the OnCreate() method of your application class:

Intercom.Initialize(this, "your api key", "your app id");

Note: If you don't currently implement a custom application, you’ll need to create one. A custom application looks like this:

public class MainApplication : Application, Application.IActivityLifecycleCallbacks {
    public override void OnCreate()
        {
            base.OnCreate();
            Intercom.Initialize(this, "your api key", "your app id");
   }
}

You’ll need to update your manifest to use your application:

<application
    android:name=".MainApplication">
</application>

Intercom must be initialized inside the application OnCreate() method. Initializing anywhere else will result in Intercom not behaving as expected and could even result in the host app crashing.

iOS

Then, initialize Intercom by calling the following in the FinishedLaunching() method of your AppDelegate class:

Intercom.SetApiKey("your api key", "your app id");

Forms

All the steps before are relevant in the "Forms", but you need to change your code like this:

Android

IntercomService.Initialize(this, "your api key", "your app id");

Note: If you don't currently implement a custom application, you’ll need to create one. A custom application looks like this:

public class MainApplication : Application, Application.IActivityLifecycleCallbacks {
    public override void OnCreate()
        {
            base.OnCreate();
            IntercomService.Initialize(this, "your api key", "your app id");
   }
}

You’ll need to update your manifest to use your application:

<application
    android:name=".MainApplication">
</application>

IntercomService must be initialized inside the application OnCreate() method. Initializing anywhere else will result in Intercom not behaving as expected and could even result in the host app crashing.

iOS

Then, initialize Intercom by calling the following in the FinishedLaunching() method of your AppDelegate class:

IntercomService.Initialize("your api key", "your app id");

Step 3 - Create a user and display messenger

Finally, you’ll need to create a user, like this:

Android

Registration registration = Registration.Create().WithUserId("123456");
Intercom.Client().RegisterIdentifiedUser(registration);
Intercom.Client().DisplayMessenger();

iOS

Intercom.iOS.Intercom.SetApiKey("your api key", "your app id");
Intercom.iOS.Intercom.RegisterUnidentifiedUser();
Intercom.iOS.Intercom.PresentConversationList();

Forms

Then, register user by calling the following in the OnAppearing()` method of your Page class:

CrossIntercomService.Current.RegisterUserWithUserId("123456");
CrossIntercomService.Current.PresentMessenger();

Available methods:

void EnableLogging();
void HandleIntercomPushNotification(Dictionary<string, string> userInfo);
void HideMessenger();
bool IsIntercomPushNotification(Dictionary<string, string> userInfo);
void LogEventWithName(string name);
void LogEventWithName(string name, Dictionary<string, string> metaData);
void Logout();
void PresentConversationList();
void PresentHelpCenter();
void PresentMessageComposer(string initialMessage);
void PresentMessageComposer();
void PresentMessageComposerWithInitialMessage(string message);
void PresentMessenger();
void RegisterUnidentifiedUser();
void RegisterUserWithEmail(string email);
void RegisterUserWithUserId(string userId, string email);
void RegisterUserWithUserId(string userId);
void Reset();
void SetBottomPadding(float bottomPadding);
void SetDeviceToken(string deviceToken);
void SetInAppMessagesVisible(bool visible);
void SetLauncherVisible(bool visible);
void SetNeedsStatusBarAppearanceUpdate();
void SetUserHash(string userHash);

Use them in a cross-platform project.

That’s it - now you’ve got a working Intercom app. However, you’ll need to register your users before you can talk to them and track their activity in your app.

For more details, see Intercom for Android or Intercom for iOS.

Changelog

Version 7.1.0

📱 New Feature: Mobile Carousels

Bring your best features. We'll bring the spotlight. Use Mobile Carousels to connect with app users at every touchpoint—show them around, provide support, and highlight features you know they'll love.

Mobile Carousels are a multi-screen message designed to feel right at home in your mobile app.

  • Rich multi-screen messages.
  • Highly customizable, right inside Intercom.
  • Request device permissions like push notifications, camera, location and more.
  • Deep link into your app, open URLs, or start conversations in the Intercom Messenger.
  • Target the right message to the right audience.
  • A/B testing and control groups.
  • Goal tracking.
  • Schedule your Mobile Carousel with ease.

Upgrade to the latest version of the mobile SDK today to use the feature. No additional integration work required.

Carousel - Made for mobile - Red

anrdroid_standard

Carousel - Permissions - Android - Yellow

📱 Closed Conversations

The mobile SDK now respects the prevent replies to closed conversations setting if you have it enabled. The text composer will be disabled for closed conversations, and your users will be able to start a new conversation if they need to. The UI updates in real time as the conversation takes place.

closed convo android

For more details, see Intercom for Android changelog or Intercom for iOS changelog.

intercome.xamarin.android's People

Contributors

chuvakpavel avatar

Stargazers

 avatar  avatar

Watchers

 avatar

intercome.xamarin.android's Issues

Updating to v8 or v9

Hello,

Since Intercom v.7.2 is deprecated, will you update this one to either v8, or better yet v9?

Update intercom version and extend binding to include other methods available

Firstly, thanks so much for creating this binding - it seems to be working well from my first day of playing.

I wanted to ask about your plans (or not) to update and extend this library?

I would like to offer my time to help this process, but would need some guidance as have never successfully created a complex binding before.

Thanks again

Update

There has been a good number of changes, would it be possible to update?

[ios] Failed to create Archive

On trying to create an archive for AdHoc deployment:

There was an error unzipping the file C:\Users\kfrancis\AppData\Local\Xamarin\iOS\Archives\2022-08-25\3d9e057e.zip: Could not find a part of the path 'C:\Users\kfrancis\AppData\Local\Temp\Xamarin\Extractions\9553854c-b9ee-4d7b-9250-abcdc230c515\SuperApp.iOS 8-25-22 11.12 AM.xcarchive\Products\Applications\SuperApp.iOS.app\Frameworks\Intercom.framework\Intercom.bundle\images\[email protected]'.

I don't see anything in the example apps that looks special, but I'm sure the example apps weren't attempted to be deployed.

Any ideas?

Issue with plugin on Android

Hello,

I installed Intercome.Xamarin.Android nuget to my Xamarin Forms solution (Android project) but I can not build successful. I got this error:

image

Could you please provide a solution?

BTW, the plugin works like a charm on iOS.

UpdateUser api is missing

The api accessible with the native Intercom.client().updateUser(); call to the sdk is missing from this implementation of the bindings.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.