-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
83 changed files
with
276 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
# Added | ||
- Initial release of the DevRev SDK. | ||
- Added the PLuG support chat feature. | ||
- Added user identification. | ||
- Added support for tracking analytics events. | ||
|
||
# Changed | ||
- Updated the initial configuration method. | ||
- Updated the support widget to version 2.0. | ||
|
||
# Deprecated | ||
- Removed the organization slug (`organizationSlug`) parameter from the configuration method. | ||
|
||
For installation instructions, consult the [documentation](README.md). |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,14 +5,21 @@ | |
- [Setting up the DevRev SDK](#setting-up-the-devrev-sdk) | ||
- [Step 1: Credentials](#step-1-credentials) | ||
- [Step 2: Initialization](#step-2-initialization) | ||
- [Example](#example) | ||
- [UIKit apps](#uikit-apps) | ||
- [SwiftUI apps](#swiftui-apps) | ||
- [Features](#features) | ||
- [Identification](#identification) | ||
- [Example](#example-1) | ||
- [PLuG support chat](#plug-support-chat) | ||
- [UIKit](#uikit) | ||
- [Example](#example-2) | ||
- [SwiftUI](#swiftui) | ||
- [Example](#example) | ||
- [New conversation callback](#new-conversation-callback) | ||
- [Example](#example-3) | ||
- [Analytics](#analytics) | ||
- [Example](#example-4) | ||
- [Screenshots](#screenshots) | ||
- [Sample app](#sample-app) | ||
- [Troubleshooting](#troubleshooting) | ||
- [Cannot import the SDK into my app](#cannot-import-the-sdk-into-my-app) | ||
|
@@ -25,7 +32,6 @@ | |
- Minimum deployment target iOS 15. | ||
|
||
# Setup | ||
|
||
You can integrate the DevRev SDK in your project as a Swift Package Manager (SPM) package. | ||
|
||
Open your project in Xcode, go to the `Add Package` screen, add the following URL under `Enter Package URL`: | ||
|
@@ -39,49 +45,55 @@ Now you should be able to import and use the DevRev SDK. | |
|
||
# Setting up the DevRev SDK | ||
## Step 1: Credentials | ||
Open the **Support** settings page, then go to **PLuG Setup**. | ||
|
||
<img src="docs/screenshots/screenshot-support-settings.png" width="250" /> | ||
|
||
On the **PLuG Setup** page, you will be able to create your SDK credentials (app ID and secret). | ||
|
||
<img src="docs/screenshots/screenshot-creating-credentials.png" width="400" /> | ||
|
||
1. Open the **Settings** page. | ||
<img src="docs/screenshots/screenshot-settings-home.png" /> | ||
1. Under the **Support** section, go to **PLuG Tokens**. | ||
<img src="docs/screenshots/screenshot-support-tokens.png" width="250" /> | ||
1. On the **PLuG Tokens** page, you will be able create your credentials under the **App Credentials**. These credentials are referred to as `appID` and `secret` in the code. | ||
- Create new credentials, if none exist: | ||
<img src="docs/screenshots/screenshot-support-tokens-creating-credentials.png" width="400" /> | ||
- Or maybe reuse any existing ones: | ||
<img src="docs/screenshots/screenshot-support-tokens-existing-credentials.png" width="400" /> | ||
1. Next, you will have to open the **PLuG Settings** page, and copy the value under **Your Unique App ID**. | ||
> This value is referred to as `supportID` in the code. | ||
<img src="docs/screenshots/screenshot-support-settings.png" width="250" /> | ||
<img src="docs/screenshots/screenshot-support-settings-id.png" width="400" /> | ||
|
||
## Step 2: Initialization | ||
|
||
Once you have the credentials, you can configure the DevRev SDK in your app. The SDK will be initialized once you have called the configuration method: | ||
|
||
```swift | ||
DevRev.configure(appID: appID, secret: secret, organizationSlug: organizationSlug) | ||
DevRev.configure(appID:secret:supportID:) | ||
``` | ||
|
||
### UIKit apps | ||
#### Example | ||
```swift | ||
DevRev.configure(appID: appID, secret: secret, supportID: supportID) | ||
``` | ||
|
||
### UIKit apps | ||
Configure the SDK in the `AppDelegate.application(_:didFinishLaunchingWithOptions:)` method. | ||
|
||
### SwiftUI apps | ||
|
||
Depending on the architecture of your app, you will need to configure the SDK at your entry point or initial view of the app. | ||
|
||
# Features | ||
|
||
## Identification | ||
Certain features of the SDK **require** a user identification. Make sure that you identify the user using the `DevRev.identify(...)` function. | ||
Certain features of the SDK **require** a user identification. Make sure that you identify the user using the `DevRev.identify(_:)` function. | ||
|
||
The function accepts the `DevRev.Identification` structure, with the user ID (`userID`) as the only required property, all other properties are optional. | ||
|
||
The call would look something like this: | ||
> Note: The `DevRev.identify(_:)` function is an asynchronous one, make sure that you wrap it in a `Task` when calling it from synchronous contexts. | ||
#### Example | ||
```swift | ||
await DevRev.identify(Identification(userID: "[email protected]")) | ||
``` | ||
|
||
The identification function should be placed at the appropriate place in your app after you login your user. If you have the user information at app launch, call the function after the `DevRev.configure(...)` method. | ||
The identification function should be placed at the appropriate place in your app after you login your user. If you have the user information at app launch, call the function after the `DevRev.configure(appID:secret:supportID:)` method. | ||
|
||
## PLuG support chat | ||
|
||
### UIKit | ||
|
||
The support chat feature can be shown as a modal screen or pushed to a navigation stack. | ||
|
||
The following overloaded method will show the support screen: | ||
|
@@ -92,16 +104,46 @@ DevRev.showSupport(from:isAnimated:) | |
1. If a `UIViewController` is passed as the `from` parameter, then the screen will be shown **modally**. | ||
1. If a `UINavigationController` is passed as the `from` parameter, then the screen will be pushed onto the stack. | ||
|
||
### SwiftUI | ||
#### Example | ||
```swift | ||
DevRev.showSupport(from: mainViewController) | ||
``` | ||
|
||
### SwiftUI | ||
For SwiftUI apps we provide a specific view, you just need to use the public view property: | ||
|
||
```swift | ||
DevRev.supportView | ||
``` | ||
|
||
### Example | ||
### New conversation callback | ||
For convenience, a callback closure has been added, that way the host app will be able to access the conversation ID. | ||
|
||
```swift | ||
DevRev.conversationCreatedCompletion | ||
``` | ||
|
||
#### Example | ||
```swift | ||
DevRev.conversationCreatedCompletion = { conversationID in | ||
print("A new conversation has been created: \(conversationID).") | ||
} | ||
``` | ||
|
||
## Analytics | ||
The DevRev SDK supports sending custom analytic events using a name and a string dictionary. | ||
|
||
You can track them using the following function: | ||
```swift | ||
DevRev.trackEvent(name:properties:) | ||
``` | ||
|
||
#### Example | ||
```swift | ||
DevRev.trackEvent(name: "open-message-screen", properties: ["id": "foo-bar-1337"]) | ||
``` | ||
|
||
### Screenshots | ||
<img src="docs/screenshots/screenshot-sample-identifying-the-user.png" width="250" /> | ||
<br /> | ||
<img src="docs/screenshots/screenshot-sample-identified-user.png" width="250" /> | ||
|
@@ -120,10 +162,9 @@ Before you start using the sample app you will need to configure it to be used w | |
- Select the appropriate target (2), | ||
- Go to the Signing & Capabilities section (3), and | ||
- Select your development team under Team (4). | ||
<img src="docs/screenshots/screenshot-sample-signing.png" /> | ||
<img src="docs/screenshots/screenshot-xcode-signing.png" width="400" /> | ||
|
||
# Troubleshooting | ||
|
||
## Cannot import the SDK into my app | ||
Check the [Setup](#setup) again and make sure that DevRevSDK is properly linked. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
docs/css/documentation-topic~topic~tutorials-overview.1099452b.css
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.