Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
djorka committed Aug 17, 2023
1 parent 96bf134 commit f815c91
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ dependencies {
```java
// Java
Forethought.INSTANCE.setup("FORETHOUGHT_API_KEY", null);

// Kotlin
Forethought.setup("FORETHOUGHT_API_KEY")
```
Expand All @@ -63,7 +63,7 @@ dependencies {
```java
// Java
Forethought.INSTANCE.show();
// Kotlin
Forethought.show()
```
Expand Down Expand Up @@ -110,26 +110,26 @@ If you'd like to handoff Forethought chat to another provider, you can do so by
public void forethoughtHandoffRequested(@NonNull ForethoughtHandoffData forethoughtHandoffData) {
// Custom hand-off action
}
@Override
public void onWidgetClosed() {
// Custom close action
}
}
// Kotlin
class MainActivity : AppCompatActivity(), ForethoughtListener {
// ...
override fun forethoughtHandoffRequested(handoffData: ForethoughtHandoffData) {
// Custom hand-off action
}
override fun onWidgetClosed() {
// Custom close action
}
}
```
1. In the onCreate method, add the Activity/Fragment as a listener to the Forethought Solve SDk:
```java
// Java
Expand All @@ -139,15 +139,15 @@ If you'd like to handoff Forethought chat to another provider, you can do so by
// ...
Forethought.INSTANCE.addListener(this);
}
// Kotlin
override fun onCreate(...) {
super.onCreate(savedInstanceState)
// ...
Forethought.addListener(this)
}
```
1. Don't forget to remove the listener on the onDestory of your Activity/Fragment to prevent memory leaks.
```java
// Java
Expand All @@ -157,7 +157,7 @@ If you'd like to handoff Forethought chat to another provider, you can do so by
// Remove the listener once the activity is destroyed.
Forethought.INSTANCE.removeListener(this);
}

// Kotlin
override fun onDestroy() {
super.onDestroy()
Expand All @@ -169,4 +169,6 @@ If you'd like to handoff Forethought chat to another provider, you can do so by

### Plugins

To attach Forethought to another chat provider, such as Zendesk or Kustomer, please check out our [plugin documentation](plugins/PLUGINS.md).
**Our Plugins are no longer supported and will be deprecated in future versions**

Use your Helpdesk's SDK to handle chat handoffs however you would like in the `forethoughtHandoffRequested` method explained in the "Custom Handoff Methods" section

0 comments on commit f815c91

Please sign in to comment.