Skip to content

Commit

Permalink
fix: added java compatibility in public constructors and methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Shahroz16 committed Mar 9, 2022
1 parent e6f71df commit acdec46
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
Expand Up @@ -24,6 +24,7 @@ class CustomerIOFirebaseMessagingService : FirebaseMessagingService() {
* @param errorCallback callback containing any error occurred
* @return Boolean indicating whether this will be handled by CustomerIo
*/
@JvmOverloads
fun onMessageReceived(
context: Context,
remoteMessage: RemoteMessage,
Expand All @@ -45,6 +46,7 @@ class CustomerIOFirebaseMessagingService : FirebaseMessagingService() {
* @param token new or refreshed token
* @param errorCallback callback containing any error occurred
*/
@JvmOverloads
fun onNewToken(
token: String,
errorCallback: Action.Callback<Unit> = Action.Callback { }
Expand Down
13 changes: 1 addition & 12 deletions sdk/src/main/java/io/customer/sdk/CustomerIO.kt
Expand Up @@ -16,14 +16,11 @@ import io.customer.sdk.di.CustomerIOComponent

/**
Welcome to the Customer.io Android SDK!
This class is where you begin to use the SDK.
You must have an instance of `CustomerIO` to use the features of the SDK.
Create your own instance using
`CustomerIo.Builder(siteId: "XXX", apiKey: "XXX", region: Region.US, appContext: Application context)`
It is recommended to initialize the client in the `Application::onCreate()` method.
After the instance is created you can access it via singleton instance: `CustomerIO.instance()` anywhere,
*/

Expand All @@ -42,7 +39,7 @@ class CustomerIO internal constructor(
}
}

class Builder(
class Builder @JvmOverloads constructor(
private val siteId: String,
private val apiKey: String,
private var region: Region = Region.US,
Expand Down Expand Up @@ -117,12 +114,9 @@ class CustomerIO internal constructor(

/**
* Identify a customer (aka: Add or update a profile).
* [Learn more](https://customer.io/docs/identifying-people/) about identifying a customer in Customer.io
* Note: You can only identify 1 profile at a time in your SDK. If you call this function multiple times,
* the previously identified profile will be removed. Only the latest identified customer is persisted.
* @param identifier ID you want to assign to the customer.
* This value can be an internal ID that your system uses or an email address.
* [Learn more](https://customer.io/docs/api/#operation/identify)
Expand All @@ -136,7 +130,6 @@ class CustomerIO internal constructor(

/**
* Track an event
* [Learn more](https://customer.io/docs/events/) about events in Customer.io
* @param name Name of the event you want to track.
* @param attributes Optional event body in Map format used as JSON object
Expand All @@ -149,7 +142,6 @@ class CustomerIO internal constructor(

/**
* Track screen
* @param name Name of the screen you want to track.
* @param attributes Optional event body in Map format used as JSON object
* @return Action<Unit> which can be accessed via `execute` or `enqueue`
Expand All @@ -161,7 +153,6 @@ class CustomerIO internal constructor(

/**
* Track activity screen, `label` added for this activity in `manifest` will be utilized for tracking
* @param activity Instance of the activity you want to track.
* @param attributes Optional event body in Map format used as JSON object
* @return Action<Unit> which can be accessed via `execute` or `enqueue`
Expand All @@ -174,10 +165,8 @@ class CustomerIO internal constructor(
/**
* Stop identifying the currently persisted customer. All future calls to the SDK will no longer
* be associated with the previously identified customer.
* Note: If you simply want to identify a *new* customer, this function call is optional. Simply
* call `identify()` again to identify the new customer profile over the existing.
* If no profile has been identified yet, this function will ignore your request.
*/
fun clearIdentify() {
Expand Down

0 comments on commit acdec46

Please sign in to comment.