appsonair-react-native-apppush 0.0.2-alpha → 1.0.0-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -9,40 +9,22 @@ API either way. Nothing in your app code changes.
|
|
|
9
9
|
> [!WARNING]
|
|
10
10
|
> **Alpha release — not for production use.**
|
|
11
11
|
>
|
|
12
|
-
> `0.0
|
|
12
|
+
> `1.0.0-beta` is an early preview, intended for evaluation, prototypes, and
|
|
13
13
|
> internal test builds. Do **not** ship it in a production app or one with a
|
|
14
14
|
> large user base.
|
|
15
15
|
>
|
|
16
|
-
> - The public API may change without notice and may not stay source-compatible —
|
|
17
|
-
> expect to update your integration between releases.
|
|
18
|
-
> - Breaking changes are not limited to major versions while the package is pre-1.0.
|
|
19
|
-
> - The native SDKs underneath are pre-release too (`0.0.3-alpha`), and carry the
|
|
20
|
-
> same caveats.
|
|
21
|
-
> - Not yet proven at scale; some behaviour is still unverified in real-world use.
|
|
22
|
-
>
|
|
23
16
|
> Pin this exact version rather than a version range, and re-test on every upgrade.
|
|
24
17
|
|
|
25
|
-
> [!NOTE]
|
|
26
|
-
> Both native SDKs resolve on their own — Android from JitPack, iOS from
|
|
27
|
-
> CocoaPods — so the only setup you need is in [Setup](#setup). The backend *is*
|
|
28
|
-
> live: the SDKs register the device and sync subscription state — tags,
|
|
29
|
-
> language, opt-in — to `/v1/subscriptions`.
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
18
|
## Install
|
|
34
19
|
|
|
35
|
-
> **
|
|
20
|
+
> **Beta.** Pin this exact version — the API may change between releases. See
|
|
36
21
|
> [the notice above](#appsonair-react-native-apppush) before adopting it.
|
|
37
22
|
|
|
38
23
|
```sh
|
|
39
|
-
npm install appsonair-react-native-apppush@0.0
|
|
24
|
+
npm install appsonair-react-native-apppush@1.0.0-beta
|
|
40
25
|
npx pod-install # iOS only
|
|
41
26
|
```
|
|
42
27
|
|
|
43
|
-
`npm install appsonair-react-native-apppush` on its own will not find it: alpha
|
|
44
|
-
releases are published under the `alpha` dist-tag, not `latest`.
|
|
45
|
-
|
|
46
28
|
Autolinking does the rest — nothing to add to `MainApplication.kt` or `AppDelegate`.
|
|
47
29
|
|
|
48
30
|
| Requires | |
|
|
@@ -196,13 +178,6 @@ pod update AppsOnAir-Core
|
|
|
196
178
|
The pin goes away once the upstream podspec carries its own floor.
|
|
197
179
|
</details>
|
|
198
180
|
|
|
199
|
-
<details>
|
|
200
|
-
<summary><b>Pointing at a local iOS SDK checkout</b> — for SDK development, or if the pod hasn't propagated yet</summary>
|
|
201
|
-
|
|
202
|
-
This package depends on `AppsOnAir-AppPush` `0.0.3-alpha` from the CocoaPods
|
|
203
|
-
trunk, so `npx pod-install` normally needs no help. To build against a local
|
|
204
|
-
checkout instead, declare it in your app's Podfile — a `:path` declaration wins
|
|
205
|
-
over this package's dependency line:
|
|
206
181
|
|
|
207
182
|
```ruby
|
|
208
183
|
# ios/Podfile
|
|
@@ -232,48 +207,6 @@ Add the Google Services plugin and your `google-services.json` as you would for
|
|
|
232
207
|
any FCM app. `POST_NOTIFICATIONS` (Android 13+) is requested for you by
|
|
233
208
|
`requestPermission()`.
|
|
234
209
|
|
|
235
|
-
<details>
|
|
236
|
-
<summary><b>Kotlin version</b> — why this package pins the stdlib, and what to do if your app still fails to compile</summary>
|
|
237
|
-
|
|
238
|
-
The published native SDK (`0.0.3-alpha`) is compiled with **Kotlin 2.2.10** and
|
|
239
|
-
sets no `languageVersion` floor, so its classes carry metadata `2.2.0`. No React
|
|
240
|
-
Native release ships a Kotlin compiler that can read that — 0.76 pins 1.9.24,
|
|
241
|
-
0.77–0.78 pin 2.0.21, 0.79–0.81 pin 2.1.x — and raising your app's Kotlin to 2.2
|
|
242
|
-
is not a fix either: KGP 2.2 breaks React Native's own Gradle plugin with
|
|
243
|
-
`Found interface KotlinTopLevelExtension, but class was expected`.
|
|
244
|
-
|
|
245
|
-
This package works around it in `android/build.gradle` so you don't have to:
|
|
246
|
-
`-Xskip-metadata-version-check` lets this module read the SDK's classes, and a
|
|
247
|
-
`strictly` pin holds `kotlin-stdlib` at your app's Kotlin version — without that
|
|
248
|
-
second half the SDK drags stdlib 2.2.10 onto **your app's** compile classpath and
|
|
249
|
-
your own Kotlin stops compiling.
|
|
250
|
-
|
|
251
|
-
If your app still fails with `Module was compiled with an incompatible version of
|
|
252
|
-
Kotlin`, something else on your classpath is pulling the newer stdlib back in.
|
|
253
|
-
Check with:
|
|
254
|
-
|
|
255
|
-
```sh
|
|
256
|
-
cd android && ./gradlew :app:dependencies --configuration debugCompileClasspath | grep kotlin-stdlib
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
Both workarounds are temporary; they go away when the SDK republishes with an
|
|
260
|
-
older language version.
|
|
261
|
-
</details>
|
|
262
|
-
|
|
263
|
-
<details>
|
|
264
|
-
<summary><b>Overriding the Push SDK coordinate</b> — for a local build or a private repo</summary>
|
|
265
|
-
|
|
266
|
-
This package pins the released SDK. To point at something else, set the coordinate
|
|
267
|
-
from your app's `android/gradle.properties` — no need to patch this package:
|
|
268
|
-
|
|
269
|
-
```properties
|
|
270
|
-
# The default. Pinned to the `v`-prefixed tag because JitPack's build of the
|
|
271
|
-
# un-prefixed `0.0.3-alpha` form failed on their end -- see the comment in this
|
|
272
|
-
# package's android/gradle.properties.
|
|
273
|
-
AppsonairReactNativeApppush_pushSdkCoordinate=com.github.apps-on-air:appsonair-android-push-notification:v0.0.3-alpha
|
|
274
|
-
```
|
|
275
|
-
</details>
|
|
276
|
-
|
|
277
210
|
---
|
|
278
211
|
|
|
279
212
|
## Recipes
|
|
@@ -293,7 +226,6 @@ const granted = await AppPushService.requestPermission({ fallbackToSettings: tru
|
|
|
293
226
|
```ts
|
|
294
227
|
await AppPushService.login('user-42');
|
|
295
228
|
await AppPushService.user.addTags({ plan: 'pro', locale: 'en-IN' });
|
|
296
|
-
await AppPushService.user.addEmail('someone@example.com');
|
|
297
229
|
|
|
298
230
|
// On sign-out
|
|
299
231
|
await AppPushService.logout();
|
|
@@ -503,11 +435,6 @@ Architecture is a build-time choice on both platforms — a Metro reload won't
|
|
|
503
435
|
switch it, and Android needs `./gradlew clean` between switches because Gradle
|
|
504
436
|
caches the generated Codegen sources.
|
|
505
437
|
|
|
506
|
-
The example resolves the **published** native SDKs (`0.0.3-alpha`) the same way
|
|
507
|
-
your app does — JitPack on Android, CocoaPods on iOS. Building against sibling
|
|
508
|
-
checkouts of the SDKs instead is opt-in: `-PappsonairLocalSdk=true` on Android,
|
|
509
|
-
`APPSONAIR_LOCAL_SDK=1` on iOS. See `example/README.md`.
|
|
510
|
-
|
|
511
438
|
---
|
|
512
439
|
|
|
513
440
|
## Contributing
|
package/android/build.gradle
CHANGED
|
@@ -101,7 +101,7 @@ android {
|
|
|
101
101
|
|
|
102
102
|
// WORKAROUND -- remove once the native SDK is republished.
|
|
103
103
|
//
|
|
104
|
-
// appsonair-android-push-notification:0.0
|
|
104
|
+
// appsonair-android-push-notification:1.0.0-beta is compiled with Kotlin
|
|
105
105
|
// 2.2.10 and sets no languageVersion/apiVersion floor, so its classes carry
|
|
106
106
|
// metadata 2.2.0. React Native pins the Kotlin compiler per release -- 1.9.24
|
|
107
107
|
// on RN 0.76, 2.0.21 on 0.77-0.78, 2.1.x on 0.79-0.81 -- and none of those can
|
|
@@ -6,4 +6,4 @@ AppsonairReactNativeApppush_compileSdkVersion=35
|
|
|
6
6
|
# minSdk 24 is inherited, not chosen: the native Push SDK requires AppsOnAir Core,
|
|
7
7
|
# which is minSdk 24. Lowering this here will fail the manifest merge.
|
|
8
8
|
|
|
9
|
-
AppsonairReactNativeApppush_pushSdkCoordinate=com.github.apps-on-air:appsonair-android-push-notification:
|
|
9
|
+
AppsonairReactNativeApppush_pushSdkCoordinate=com.github.apps-on-air:appsonair-android-push-notification:1.0.0-beta
|
|
@@ -152,13 +152,13 @@ class AppsonairReactNativeApppushModuleImpl(
|
|
|
152
152
|
private fun registerActivityHooks() {
|
|
153
153
|
reactContext.addActivityEventListener(object : ActivityEventListener {
|
|
154
154
|
override fun onActivityResult(
|
|
155
|
-
activity: Activity
|
|
155
|
+
activity: Activity,
|
|
156
156
|
requestCode: Int,
|
|
157
157
|
resultCode: Int,
|
|
158
158
|
data: Intent?
|
|
159
159
|
) = Unit
|
|
160
160
|
|
|
161
|
-
override fun onNewIntent(intent: Intent
|
|
161
|
+
override fun onNewIntent(intent: Intent) {
|
|
162
162
|
AppPushService.handleNotificationTapIntent(intent)
|
|
163
163
|
}
|
|
164
164
|
})
|
|
@@ -37,7 +37,7 @@ Pod::Spec.new do |s|
|
|
|
37
37
|
# pod 'AppsOnAir-AppPush', :path => '../../appsonair-ios-push-notification'
|
|
38
38
|
#
|
|
39
39
|
# See the README's iOS installation section.
|
|
40
|
-
s.dependency 'AppsOnAir-AppPush', '0.0
|
|
40
|
+
s.dependency 'AppsOnAir-AppPush', '1.0.0-beta'
|
|
41
41
|
|
|
42
42
|
# Compensates for a missing version floor upstream, and is not redundant with
|
|
43
43
|
# the line above: AppsOnAir-AppPush.podspec declares `core.dependency
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "appsonair-react-native-apppush",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "1.0.0-beta",
|
|
4
4
|
"description": "AppsOnAir push notifications for React Native — wraps the native AppsOnAir iOS and Android Push SDKs",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|