-
Notifications
You must be signed in to change notification settings - Fork 3
feat(android): update for 2.7.8 #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| title: "Local Resources" | ||
| description: "Bundle images, videos, and other assets in your app so paywalls can load them instantly from the device." | ||
| --- | ||
|
|
||
| <include>../../../shared/local-resources.mdx</include> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| --- | ||
| title: "localResources" | ||
| description: "Register Android resources or file URIs so paywalls can load local media by resource ID." | ||
| --- | ||
|
|
||
| <Info> | ||
| Available in Android SDK `2.7.7+`. | ||
| </Info> | ||
|
|
||
| ## Purpose | ||
|
|
||
| `localResources` lets you map paywall asset IDs to local Android resources or file URIs. Paywalls can then request those assets with `swlocal://resource-id` instead of downloading them from a remote URL. | ||
|
|
||
| ## Signature | ||
|
|
||
| ```kotlin | ||
| var localResources: Map<String, PaywallResource> | ||
| ``` | ||
|
|
||
| ```java | ||
| public Map<String, PaywallResource> getLocalResources() | ||
| public void setLocalResources(Map<String, PaywallResource> localResources) | ||
| ``` | ||
|
|
||
| ## Schema | ||
|
|
||
| <TypeTable | ||
| type={{ | ||
| key: { | ||
| type: "String", | ||
| description: "The resource ID used in the paywall editor or in a `swlocal://resource-id` URL.", | ||
| required: true, | ||
| }, | ||
| value: { | ||
| type: "PaywallResource", | ||
| description: "The local Android asset to serve for that resource ID.", | ||
| required: true, | ||
| }, | ||
| }} | ||
| /> | ||
|
|
||
| ## PaywallResource variants | ||
|
|
||
| <TypeTable | ||
| type={{ | ||
| "PaywallResource.FromResources(resId)": { | ||
| type: "Int", | ||
| description: "Use an Android resource ID from `res/drawable`, `res/raw`, or another packaged resource folder.", | ||
| required: true, | ||
| }, | ||
| "PaywallResource.FromUri(uri)": { | ||
| type: "Uri", | ||
| description: "Use a local `Uri`, such as a file in app storage or a content provider URL.", | ||
| required: true, | ||
| }, | ||
| }} | ||
| /> | ||
|
|
||
| ## Returns / State | ||
|
|
||
| This is a mutable property on [`Superwall.instance`](/android/sdk-reference/Superwall). Set it before presenting paywalls that depend on local assets. | ||
|
|
||
| ## Related | ||
|
|
||
| - [Local Resources guide](/android/guides/local-resources) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,14 +6,16 @@ description: "Use images, videos, and other media bundled in your app for faster | |
| Local resources let you reference media files (such as images and videos) that are bundled directly in your app rather than hosted on a remote server. This means faster load times, no network dependency for those assets, and a smoother experience for your users. | ||
|
|
||
| <Note> | ||
| Local resources require **iOS SDK v4.13.0+** or **Android SDK v2.5.0+**. They are not available on | ||
| Local resources require **iOS SDK v4.13.0+** or **Android SDK v2.7.7+**. They are not available on | ||
| other platforms at this time. | ||
| </Note> | ||
|
|
||
| ### How it works | ||
|
|
||
| Instead of pointing an image or video to a URL, you can point it to a **local resource ID**. This ID maps to a file that the developer has registered in the native SDK. When the paywall loads, the SDK intercepts the request and serves the file directly from the device. No network call is required. | ||
|
|
||
| Set up those resource IDs in your app first by following the [SDK Local Resources guide](/sdk/guides/local-resources). | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dashboard links to nonexistent
|
||
|
|
||
| The editor discovers which resource IDs are available by looking at device attribute events your app has reported in the last 7 days. This means at least one device running your app with the SDK configured must have reported its local resources before they appear in the editor. | ||
|
|
||
| ### Setting a local resource on an image | ||
|
|
@@ -46,7 +48,7 @@ This means you can safely set a local resource without breaking the paywall for | |
|
|
||
| The resource ID dropdown is populated from device attribute events sent by your app. If you don't see any resource IDs: | ||
|
|
||
| - Make sure at least one test device is running your app with the local resources configured in the SDK (see the [iOS guide](/ios/guides/local-resources) for setup instructions). | ||
| - Make sure at least one test device is running your app with the local resources configured in the SDK. For setup instructions, see the [SDK Local Resources guide](/sdk/guides/local-resources). | ||
| - The device must have opened a paywall or otherwise triggered a device attributes event within the **last 7 days**. | ||
| - Only **iOS** and **Android** platforms support local resources. The dropdown will not appear for other platforms. | ||
|
|
||
|
|
@@ -68,6 +70,6 @@ For smaller or frequently changing images, remote URLs are still the simpler cho | |
|
|
||
| ### Related | ||
|
|
||
| - [iOS SDK: Local Resources Guide](/ios/guides/local-resources): How to register local resources in the iOS SDK. | ||
| - [SDK Local Resources Guide](/sdk/guides/local-resources): How to register local resources in supported SDKs. | ||
| - [Styling Elements](/paywall-editor-styling-elements): General component styling and image editing. | ||
| - [Liquid inside Image URLs](/paywall-editor-liquid#liquid-inside-image-urls): Using dynamic URLs for images. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| --- | ||
| title: "localResources" | ||
| description: "Register local file URLs so paywalls can load bundled media by resource ID." | ||
| --- | ||
|
|
||
| <Info> | ||
| Available in iOS SDK `4.13.0+`. | ||
| </Info> | ||
|
|
||
| ## Purpose | ||
|
|
||
| `localResources` maps resource IDs to local file URLs so paywalls can request bundled media with `swlocal://resource-id` instead of downloading them from a remote URL. | ||
|
|
||
| ## Signature | ||
|
|
||
| ```swift | ||
| public var localResources: [String: URL] | ||
| ``` | ||
|
|
||
| ## Schema | ||
|
|
||
| <TypeTable | ||
| type={{ | ||
| key: { | ||
| type: "String", | ||
| description: "The resource ID used in the paywall editor or in a `swlocal://resource-id` URL.", | ||
| required: true, | ||
| }, | ||
| value: { | ||
| type: "URL", | ||
| description: "A local file URL from your app bundle or sandbox.", | ||
| required: true, | ||
| }, | ||
| }} | ||
| /> | ||
|
|
||
| ## Returns / State | ||
|
|
||
| This is a mutable property on [`SuperwallOptions`](/ios/sdk-reference/SuperwallOptions). Set it before calling [`configure()`](/ios/sdk-reference/configure). | ||
|
|
||
| ## Related | ||
|
|
||
| - [Local Resources guide](/ios/guides/local-resources) |


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
content/docs/android/changelog.mdxnow lists 2.7.8/2.7.7 changes that differ from the upstream release notes referenced by this update (for example, 2.7.8 is missing thegetEntitlements()/dependency notes and 2.7.7 is missing the ProGuardJsonDataExceptionfix), so readers can make upgrade decisions based on incorrect information. This also violates the repository rule inAGENTS.mdthat SDK changelog entries must be copied verbatim fromreference/<sdk>/CHANGELOG.md.Useful? React with 👍 / 👎.