Hi All,
I recently integrated my GWT app with intercom.io and I thought I would 
share the details with the community.

1. Add the following to your root HTML file

<script type="text/javascript" src=
"https://api.intercom.io/api/js/library.js";></script>

2. create a function and call it each time the user logs in

native public static void initIntercom(String emailAddress,String 
dateCreated,String staffName,String userName,

   String webhandle,String businessName,String plan,String spend,String 
companyCreatedDate) /*-{

  

$wnd.Intercom('boot', {

              app_id: '93r67uod',

              email: emailAddress,

              created_at: dateCreated,

              name: staffName,

              user_id: userName,

              company: {

    "id": webhandle, 

    "name": businessName, 

    "plan": plan,

    "monthly_spend": spend,

    "created_at" : companyCreatedDate

  }

            });            

}-*/;


3. Call this method each time you show a different view. This could be 
called from an AppController

 native public static void updateIntercom() /*-{

$wnd.Intercom('update');

 }-*/;

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to