Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- README examples for configuring a custom CNAME endpoint on iOS (`MPNetworkOptions.customBaseURL`) and Android (`NetworkOptions.withNetworkOptions`).

## [3.0.1] - 2026-05-27

### Fixed
Expand Down
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,20 @@ didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
}
```

Routing the Rokt SDK+ through your own domain reduces the risk of ad blockers and browsers from blocking ads or data. You can configure this with `MPNetworkOptions`:

```swift
let networkOptions = MPNetworkOptions()
networkOptions.customBaseURL = URL(string: "https://rkt.example.com")
mParticleOptions.networkOptions = networkOptions
```

```objective-c
MPNetworkOptions *networkOptions = [MPNetworkOptions new];
networkOptions.customBaseURL = [NSURL URLWithString:@"https://rkt.example.com"];
mParticleOptions.networkOptions = networkOptions;
```

Please see [Identity](http://docs.mparticle.com/developers/sdk/ios/identity/) for more information on supplying an `MPIdentityApiRequest` object during SDK initialization.


Expand All @@ -114,7 +128,7 @@ class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
val options: MParticleOptions = MParticleOptions.builder(this)
.credentials("REPLACE ME WITH KEY", "REPLACE ME WITH SECRET")
.credentials("REPLACE_ME_WITH_KEY", "REPLACE_ME_WITH_SECRET")
.logLevel(MParticle.LogLevel.VERBOSE)
.identify(identifyRequest)
.identifyTask(
Expand All @@ -128,6 +142,26 @@ class MyApplication : Application() {
}
```

Routing the Rokt SDK+ through your own domain reduces the risk of ad blockers and browsers from blocking ads or data. You can configure this with `NetworkOptions`:

```java
import com.mparticle.networking.NetworkOptions;

MParticleOptions options = MParticleOptions.builder(this)
.credentials("REPLACE_ME_WITH_KEY", "REPLACE_ME_WITH_SECRET")
.networkOptions(NetworkOptions.withNetworkOptions("https://rkt.example.com"))
.build();
```

```kotlin
import com.mparticle.networking.NetworkOptions

val options = MParticleOptions.builder(this)
.credentials("REPLACE_ME_WITH_KEY", "REPLACE_ME_WITH_SECRET")
.networkOptions(NetworkOptions.withNetworkOptions("https://rkt.example.com"))
.build()
```

> **Warning:** It's generally not a good idea to log events in your `Application.onCreate()`. Android may instantiate your `Application` class for a lot of reasons, in the background, while the user isn't even using their device.


Expand Down
Loading