Skip to content

Commit

Permalink
Release 10.0.0 (#299)
Browse files Browse the repository at this point in the history
* 10.0.0 features added

* Fixed objective C styles

* Updated CHANGELOG.md and README.md
  • Loading branch information
prithivraj authored Jun 29, 2021
1 parent b6fda69 commit fd968d9
Show file tree
Hide file tree
Showing 25 changed files with 601 additions and 16 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Intercom for Cordova/PhoneGap

## 10.0.0 (2021-06-29)
#### v10.0.0 of the Cordova plugin supports the latest version (10.0.1) of the Intercom mobile SDK.
##### Enhancements
* We have redesigned the Help Center for mobile apps. ✨
* New UI, optimized specifically for mobile apps and small screens
* Type-ahead search to help users find answers quicker than ever
* Control whether users open up a specific collection of articles, a group of collections, or specific search results
* Localization - with right to left language display
* Accessibility support: screen readers, dynamic font sizes, and keyboard navigation - to support all end users
* New Help Center Data API that enables you to build your own help center UI, enabling a much deeper and custom integration into your app.
##### Improvements and bug fixes
* Fixed an issue where the special notice message would not display.
* `hideMessenger()` has now been deprecated and removed. Please use `hideIntercom()` instead. This method will hide all Intercom UI in your app.

## 9.4.0 (2020-11-17)
* Updated both the Android and iOS SDK to 9.0.0
* On iOS, cocoapods 1.10 is required to install the iOS SDK correctly.
Expand Down
7 changes: 6 additions & 1 deletion Example/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@
<p><button id="login-btn">Login</button></p>
<p><button id="logout-btn">Logout</button></p>
<p><button id="open-intercom-btn">Open Intercom</button></p>
<p><button id="open-help-center-btn">Open Help Center</button></p>
<p><button id="display-carousel-btn">Display Carousel</button></p>
<p><button id="display-article-btn">Display Article</button></p>
<p><button id="open-help-center-btn">Open Help Center</button></p>
<p><button id="open-help-center-filtered-btn">Open Filtered Help Center</button></p>
<h5>Help Center Data API</h5>
<p><button id="help-center-data-api-fetch-btn">Fetch collections</button></p>
<p><button id="help-center-data-api-fetch-content-btn">Fetch collection content</button></p>
<p><button id="help-center-data-api-search-btn">Search help center</button></p>
</div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
Expand Down
40 changes: 40 additions & 0 deletions Example/www/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,46 @@ var app = {
intercom.displayHelpCenter();
}, false);

document.getElementById("open-help-center-filtered-btn").addEventListener("click", function(){
// Replace this with your own collections
var ids = ["COLLECTION_ID1", "COLLECTION_ID2"];
intercom.displayHelpCenterCollections({collectionIds: ids});
}, false);

document.getElementById("help-center-data-api-fetch-btn").addEventListener("click", function(){
var onSuccess = function(data) {
console.log('Successfully fetched collections : ' + data);
}
var onError = function(code) {
console.log('Failed to fetch collections with code :' + data);
}
intercom.fetchHelpCenterCollections(onSuccess, onError);
}, false);

document.getElementById("help-center-data-api-fetch-content-btn").addEventListener("click", function(){
// Add your collection Id here
var collectionId = "COLLECTION_ID"
var onSuccess = function(data) {
console.log('Successfully fetched collection content : ' + data);
}
var onError = function(code) {
console.log('Failed to fetch collection content with code :' + data);
}
intercom.fetchHelpCenterCollection(collectionId, onSuccess, onError);
}, false);

document.getElementById("help-center-data-api-search-btn").addEventListener("click", function(){
// Add your search term here
var searchTerm = "SEARCH_TERM"
var onSuccess = function(data) {
console.log('Successfully searched help center : ' + data);
}
var onError = function(code) {
console.log('Failed to search help center with code :' + data);
}
intercom.searchHelpCenter(searchTerm, onSuccess, onError);
}, false);

document.getElementById("display-carousel-btn").addEventListener("click", function(){
intercom.displayCarousel("carousel-id");
}, false);
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ cordova plugin add cordova-plugin-intercom

To add the plugin to your PhoneGap app, add the following to your `config.xml`:
```xml
<plugin name="cordova-plugin-intercom" version="~9.4.0" />
<plugin name="cordova-plugin-intercom" version="~10.0.0" />
```

## Example App
Expand Down
2 changes: 2 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
- run:
name: Install node/npm
command: |
curl -O https://packages.cloud.google.com/apt/doc/apt-key.gpg && sudo apt-key add apt-key.gpg
curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -
sudo apt install -y nodejs
- run:
Expand All @@ -64,6 +65,7 @@ jobs:
- run:
name: Install node/npm
command: |
curl -O https://packages.cloud.google.com/apt/doc/apt-key.gpg && sudo apt-key add apt-key.gpg
curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -
sudo apt install -y nodejs
- run:
Expand Down
2 changes: 1 addition & 1 deletion intercom-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-intercom",
"version": "9.4.0",
"version": "10.0.0",
"description": "Official Cordova/PhoneGap plugin for Intercom",
"cordova": {
"id": "cordova-plugin-intercom",
Expand Down
17 changes: 15 additions & 2 deletions intercom-plugin/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<plugin id="cordova-plugin-intercom" version="9.4.0" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<plugin id="cordova-plugin-intercom" version="10.0.0" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<name>Intercom</name>
<author>Intercom</author>
<license>MIT License</license>
Expand All @@ -26,6 +26,16 @@

<header-file src="src/ios/IntercomBridge.h" />
<source-file src="src/ios/IntercomBridge.m" />
<source-file src="src/ios/ICMHelpCenterCollection+DictionaryConversion.h" />
<source-file src="src/ios/ICMHelpCenterCollection+DictionaryConversion.m" />
<source-file src="src/ios/ICMHelpCenterArticleSearchResult+DictionaryConversion.h" />
<source-file src="src/ios/ICMHelpCenterArticleSearchResult+DictionaryConversion.m" />
<source-file src="src/ios/ICMHelpCenterArticle+DictionaryConversion.h" />
<source-file src="src/ios/ICMHelpCenterArticle+DictionaryConversion.m" />
<source-file src="src/ios/ICMHelpCenterCollectionContent+DictionaryConversion.h" />
<source-file src="src/ios/ICMHelpCenterCollectionContent+DictionaryConversion.m" />
<source-file src="src/ios/ICMHelpCenterSection+DictionaryConversion.h" />
<source-file src="src/ios/ICMHelpCenterSection+DictionaryConversion.m" />

<header-file src="src/ios/AppDelegate+IntercomPush.h" />
<source-file src="src/ios/AppDelegate+IntercomPush.m" />
Expand All @@ -52,13 +62,16 @@
<source url="https://cdn.cocoapods.org/"/>
</config>
<pods use-frameworks="true">
<pod name="Intercom" spec="~> 9.0.0" />
<pod name="Intercom" spec="~> 10.0.1" />
</pods>
</podspec>
</platform>

<platform name="android">
<source-file src="src/android/IntercomBridge.java" target-dir="src/io/intercom/android/sdk" />
<source-file src="src/android/HelpCenterCollectionModel.java" target-dir="src/io/intercom/android/sdk" />
<source-file src="src/android/HelpCenterCollectionContentModel.java" target-dir="src/io/intercom/android/sdk" />
<source-file src="src/android/HelpCenterCollectionSectionModel.java" target-dir="src/io/intercom/android/sdk" />
<source-file src="src/android/CordovaHeaderInterceptor.java" target-dir="src/io/intercom/android/sdk" />

<framework src="src/android/intercom.gradle" custom="true" type="gradleReference" />
Expand Down
28 changes: 28 additions & 0 deletions intercom-plugin/src/android/HelpCenterCollectionContentModel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package io.intercom.android.sdk;

import java.util.List;

import io.intercom.android.sdk.helpcenter.sections.HelpCenterArticle;
import io.intercom.android.sdk.helpcenter.sections.HelpCenterSection;

public class HelpCenterCollectionContentModel {
private String collectionId;
private List<HelpCenterArticle> articles;
private List<HelpCenterCollectionSectionModel> sections;
private String summary;
private String title;

public HelpCenterCollectionContentModel(
String collectionId,
List<HelpCenterArticle> articles,
List<HelpCenterCollectionSectionModel> sections,
String summary,
String title
) {
this.collectionId = collectionId;
this.articles = articles;
this.sections = sections;
this.summary = summary;
this.title = title;
}
}
17 changes: 17 additions & 0 deletions intercom-plugin/src/android/HelpCenterCollectionModel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package io.intercom.android.sdk;

public class HelpCenterCollectionModel {
private String collectionId;
private String summary;
private String title;

public HelpCenterCollectionModel(
String collectionId,
String summary,
String title
) {
this.collectionId = collectionId;
this.summary = summary;
this.title = title;
}
}
18 changes: 18 additions & 0 deletions intercom-plugin/src/android/HelpCenterCollectionSectionModel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package io.intercom.android.sdk;

import java.util.List;

import io.intercom.android.sdk.helpcenter.sections.HelpCenterArticle;

class HelpCenterCollectionSectionModel {
private List<HelpCenterArticle> articles;
private String title;

public HelpCenterCollectionSectionModel(
List<HelpCenterArticle> articles,
String title
) {
this.articles = articles;
this.title = title;
}
}
Loading

0 comments on commit fd968d9

Please sign in to comment.