Skip to content

Commit

Permalink
improve: update the content provider's init-order to high value (SDKC…
Browse files Browse the repository at this point in the history
…F-5292)
  • Loading branch information
leila-gu authored May 18, 2022
1 parent cf09513 commit 9b644a3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,20 @@ dependency {

### 2. Set initialization order (optional)

You only need to set this if you are facing an Exception when trying to use features of this SDK at launch time.

This SDK uses a `ContentProvider` in order to automatically initialize. If you are also using a ContentProvider in your App
or you are developing an SDK which uses a ContentProvider to automatically initialize, then you may need to manually set the
⚠️ This SDK uses a `ContentProvider` in order to automatically initialize. It is not recommended to override the default value set for `initOrder`.
However, you may need to set it if you are facing an Exception when trying to use features of this SDK at launch time. If you are also using a ContentProvider in your App or you are developing an SDK which uses a ContentProvider to automatically initialize, then you may need to manually set the
`initOrder` for this SDK so that it is initialized first. This can be set in `AndroidManifest.xml`:

```xml
<application>
<!-- The `initOrder` for this SDK is set to `99` by default. -->
<!-- Set it to something higher to make it initialize before your own ContentProvider. -->
<!-- The `initOrder` for this SDK is set to `9999` by default. -->
<!-- ⚠️ It is not recommended to override the `initOrder`, however, if you need to manually set it, make sure that it is initialized before your own ContentProvider. -->
<provider
tools:replace="android:initOrder"
android:name="com.rakuten.tech.mobile.sdkutils.SdkUtilsInitProvider"
android:authorities="${applicationId}.SdkUtilsInitProvider"
android:exported="false"
android:initOrder="100" />
android:initOrder="9999" />
</application>
```

Expand Down Expand Up @@ -227,6 +225,9 @@ val retrofit = Retrofit.Builder().build("your_baseUrl", okHttpClient gsonConvert

## Changelog

### v1.2.0 (in progress)
* SDKCF-5292: Set initOrder of the content provider to a high value to make sure that it is initialized before the host app ContentProvider.

### v1.1.0 (2022-03-17)

* SDKCF-4887: Added NetworkUtil for checking network connectivity and capabilities. Please see [usage](#networking-utility) section for details.
Expand Down
5 changes: 4 additions & 1 deletion sdk-utils/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
xmlns:android="http://schemas.android.com/apk/res/android">

<application>
<!-- It is not recommended to override the `initOrder`, however,
if you need to manually set it, make sure that it is initialized before your own
ContentProvider. -->
<provider
android:name="com.rakuten.tech.mobile.sdkutils.SdkUtilsInitProvider"
android:authorities="${applicationId}.SdkUtilsInitProvider"
android:exported="false"
android:initOrder="99" />
android:initOrder="9999" />
</application>
</manifest>

0 comments on commit 9b644a3

Please sign in to comment.