diff --git a/.github/workflows/doc-bot.yml b/.github/workflows/doc-bot.yml new file mode 100644 index 000000000..60d8597ab --- /dev/null +++ b/.github/workflows/doc-bot.yml @@ -0,0 +1,57 @@ +name: Generate release docs and commit to documentation branch (which is published to github pages) + +on: + release: + types: [released] + push: + branches: + - master + +jobs: + dokka: + runs-on: ubuntu-22.04 + env: + CI_COMMIT_MESSAGE: Generated docs for ${{ github.sha }} + GH_TOKEN: ${{ github.token }} + + steps: + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 17 + + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: documentation + fetch-depth: 0 + + - name: Git config + run: | + git config user.name github-actions + git config user.email github-actions@github.com + git fetch origin + + - name: Update documentation branch from master + run: | + git checkout -b "documentation-${{ github.sha }}" + git merge origin/master -m "Merge changes from master for ${{ github.sha }}" --no-edit --strategy-option theirs + + - name: Generate Dokka documentation + run: ./gradlew dokkaHtmlMultiModule + + - name: Commit and push documentation + run: | + if [ $(git status -s -uno | wc -l) -eq 0 ]; then + echo "No documentation to change" + exit 0 + fi + + git add . + git commit -m "${{ env.CI_COMMIT_MESSAGE }}" + git push -u origin "documentation-${{ github.sha }}" + + - name: Create PR for doc updates + run: | + gh pr create --title "Generated Docs for \"$(git show -s --format=%B ${{ github.sha }})\"" --body "This PR was automatically generated by a GitHub Action for ${{ github.sha }}." -B "documentation" -H "documentation-${{ github.sha }}" diff --git a/README.md b/README.md index 9d3d2a55a..3b1e05b7f 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ The Klaviyo Android SDK allows developers to incorporate Klaviyo analytics and push notification functionality in their native Android applications. The SDK assists in identifying users and tracking user events via the -latest [Klaviyo client APIs](https://developers.klaviyo.com/en/reference/api_overview). +latest [Klaviyo Client APIs](https://developers.klaviyo.com/en/reference/api_overview). To reduce performance overhead, API requests are queued and sent in batches. The queue is persisted to local storage so that data is not lost if the device is offline or the app is terminated. @@ -107,7 +107,8 @@ The SDK provides methods to identify profiles via the [Create Client Profile API](https://developers.klaviyo.com/en/reference/create_client_profile). A profile can be identified by any combination of the following: -- External ID: A unique identifier used by customers to associate Klaviyo profiles with profiles in an external system, such as a point-of-sale system. Format varies based on the external system. +- External ID: A unique identifier used by customers to associate Klaviyo profiles with profiles in an external system, + such as a point-of-sale system. Format varies based on the external system. - Individual's email address - Individual's phone number in [E.164 format](https://help.klaviyo.com/hc/en-us/articles/360046055671#h_01HE5ZYJEAHZKY6WZW7BAD36BG) @@ -282,7 +283,7 @@ override fun onNewIntent(intent: Intent?) { } ``` -**Note** intent handling may differ depending on your app's architecture. Adjust this example to your use-case, +**Note:** Intent handling may differ depending on your app's architecture. Adjust this example to your use-case, ensuring that `Klaviyo.handlePush(intent)` is called when your app is opened from a notification. #### Deep Linking @@ -353,13 +354,11 @@ deep links in your app. containing a deep link from the Klaviyo push editor. For additional resources on deep linking, refer to -[Android developer documentation](https://developer.android.com/training/app-links/deep-linking) +[Android developer documentation](https://developer.android.com/training/app-links/deep-linking). ### Advanced Setup If you'd prefer to have your own implementation of `FirebaseMessagingService`, follow the FCM setup docs including referencing your own service class in the manifest. -The `Application` code snippets above for handling push tokens and intents are still required. -You may either subclass `KlaviyoPushService` or invoke the necessary Klaviyo SDK methods in your service. ```xml @@ -376,6 +375,10 @@ You may either subclass `KlaviyoPushService` or invoke the necessary Klaviyo SDK ``` +The `Application` code snippets above for handling push tokens and intents are still required. + +You may either subclass `KlaviyoPushService` or invoke the necessary Klaviyo SDK methods in your service. + 1. Subclass `KlaviyoPushService`: ```kotlin import com.google.firebase.messaging.RemoteMessage @@ -429,7 +432,7 @@ You may either subclass `KlaviyoPushService` or invoke the necessary Klaviyo SDK } ``` -**Note** Klaviyo uses [`data` messages](https://firebase.google.com/docs/cloud-messaging/android/receive) +**Note:** Klaviyo uses [data messages](https://firebase.google.com/docs/cloud-messaging/android/receive) to provide consistent notification formatting. As a result, all Klaviyo notifications are handled via `onMessageReceived` regardless of the app being in the background or foreground. If you are working with multiple remote sources, you can check whether a message originated @@ -441,8 +444,13 @@ extensions such as `import com.klaviyo.pushFcm.KlaviyoRemoteMessage.body` to acc We also provide an `Intent.appendKlaviyoExtras(RemoteMessage)` extension method, which attaches the data to your notification intent that the Klaviyo SDK requires in order to track opens when you call `Klaviyo.handlePush(intent)`. +## Contributing +See the [contributing guide](.github/CONTRIBUTING.md) to learn how to contribute to the Klaviyo Android SDK. +We welcome your feedback in the [discussion](https://github.com/klaviyo/klaviyo-android-sdk/discussions) +and [issues](https://github.com/klaviyo/klaviyo-android-sdk/issues) sections of our public GitHub repository. + ## License -KlaviyoSwift is available under the MIT license. See [LICENSE](./LICENSE.md) for more info. +The Klaviyo Android SDK is available under the MIT license. See [LICENSE](./LICENSE.md) for more info. ## Code Documentation -Browse complete code documentation autogenerated with Dokka [here](https://klaviyo.github.io/klaviyo-android-sdk/) +Browse complete code documentation autogenerated with Dokka [here](https://klaviyo.github.io/klaviyo-android-sdk/). diff --git a/docs/2.0.0/index.html b/docs/2.0.0/index.html index e0e574231..e61500802 100644 --- a/docs/2.0.0/index.html +++ b/docs/2.0.0/index.html @@ -64,7 +64,7 @@
The Klaviyo Android SDK allows developers to incorporate Klaviyo analytics and push notification functionality in their native Android applications. The SDK assists in identifying users and tracking user events via the latest Klaviyo client APIs. To reduce performance overhead, API requests are queued and sent in batches. The queue is persisted to local storage so that data is not lost if the device is offline or the app is terminated.
+The Klaviyo Android SDK allows developers to incorporate Klaviyo analytics and push notification functionality in their native Android applications. The SDK assists in identifying users and tracking user events via the latest Klaviyo Client APIs. To reduce performance overhead, API requests are queued and sent in batches. The queue is persisted to local storage so that data is not lost if the device is offline or the app is terminated.
Once integrated, your marketing team will be able to better understand your app users' needs and send them timely push notifications via FCM (Firebase Cloud Messaging).
⚠️ We support Android API level 23 and above ⚠️
@@ -114,7 +114,7 @@Profile Identification
The SDK provides methods to identify profiles via the Create Client Profile API. A profile can be identified by any combination of the following:
- -
External ID: A unique identifier used by customers to associate Klaviyo profiles with profiles in an external system, such as a point-of-sale system. Format varies based on the external system.
+External ID: A unique identifier used by customers to associate Klaviyo profiles with profiles in an external system, such as a point-of-sale system. Format varies based on the external system.
Individual's email address
@@ -201,7 +201,7 @@Tracking Open Events
Content copied to clipboard
Note intent handling may differ depending on your app's architecture. Adjust this example to your use-case, ensuring that Klaviyo.handlePush(intent)
is called when your app is opened from a notification.
Note: Intent handling may differ depending on your app's architecture. Adjust this example to your use-case, ensuring that Klaviyo.handlePush(intent)
is called when your app is opened from a notification.
Deep Links allow you to navigate to a particular page within your app in response to the user opening a notification. There are broadly three steps to implement deep links in your app.
To perform integration testing, you can send a preview push notification containing a deep link from the Klaviyo push editor.
For additional resources on deep linking, refer to Android developer documentation
+For additional resources on deep linking, refer to Android developer documentation.
If you'd prefer to have your own implementation of FirebaseMessagingService
, follow the FCM setup docs including referencing your own service class in the manifest. The Application
code snippets above for handling push tokens and intents are still required. You may either subclass KlaviyoPushService
or invoke the necessary Klaviyo SDK methods in your service.
If you'd prefer to have your own implementation of FirebaseMessagingService
, follow the FCM setup docs including referencing your own service class in the manifest.
<!-- AndroidManifest.xml -->
<manifest>
<!-- ... -->
<application>
<!-- ... -->
<service android:name="your.package.name.YourPushService" android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
</application>
</manifest>
The Application
code snippets above for handling push tokens and intents are still required.
You may either subclass KlaviyoPushService
or invoke the necessary Klaviyo SDK methods in your service.
Subclass KlaviyoPushService
:
Note Klaviyo uses data
messages to provide consistent notification formatting. As a result, all Klaviyo notifications are handled via onMessageReceived
regardless of the app being in the background or foreground. If you are working with multiple remote sources, you can check whether a message originated from Klaviyo with the extension method RemoteMessage.isKlaviyoNotification
.
Note: Klaviyo uses data messages to provide consistent notification formatting. As a result, all Klaviyo notifications are handled via onMessageReceived
regardless of the app being in the background or foreground. If you are working with multiple remote sources, you can check whether a message originated from Klaviyo with the extension method RemoteMessage.isKlaviyoNotification
.
If you wish to fully customize the display of notifications, we provide a set of RemoteMessage
extensions such as import com.klaviyo.pushFcm.KlaviyoRemoteMessage.body
to access all the properties sent from Klaviyo. We also provide an Intent.appendKlaviyoExtras(RemoteMessage)
extension method, which attaches the data to your notification intent that the Klaviyo SDK requires in order to track opens when you call Klaviyo.handlePush(intent)
.
See the .github/CONTRIBUTING.md to learn how to contribute to the Klaviyo Android SDK. We welcome your feedback in the discussion and issues sections of our public GitHub repository.
KlaviyoSwift is available under the MIT license. See ./LICENSE.md for more info.
+The Klaviyo Android SDK is available under the MIT license. See ./LICENSE.md for more info.
Browse complete code documentation autogenerated with Dokka here
+Browse complete code documentation autogenerated with Dokka here.