File tree Expand file tree Collapse file tree 6 files changed +34
-21
lines changed
java/com/urbanairship/reactnative Expand file tree Collapse file tree 6 files changed +34
-21
lines changed Original file line number Diff line number Diff line change @@ -3,4 +3,4 @@ Airship_minSdkVersion=23
33Airship_targetSdkVersion =35
44Airship_compileSdkVersion =35
55Airship_ndkversion =26.1.10909125
6- Airship_airshipProxyVersion =14.9 .0
6+ Airship_airshipProxyVersion =14.10 .0
Original file line number Diff line number Diff line change 99
1010 <service
1111 android : name =" com.urbanairship.reactnative.AirshipHeadlessEventService"
12- android : exported =" false" />
12+ android : exported =" false"
13+ android : stopWithTask =" true" />
1314
1415 <activity
1516 android : name =" com.urbanairship.android.framework.proxy.CustomMessageCenterActivity"
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ class AirshipHeadlessEventService : HeadlessJsTaskService() {
2626 }
2727
2828 companion object {
29- private const val TASK_TIMEOUT : Long = 60000
29+ private const val TASK_TIMEOUT : Long = 1000
3030 private const val TASK_KEY = " AirshipAndroidBackgroundEventTask"
3131
3232 fun startService (context : Context ): Boolean {
Original file line number Diff line number Diff line change 11import { AppRegistry } from 'react-native' ;
22import App from './src/App' ;
33import { name as appName } from './app.json' ;
4+ import Airship , { EventType } from '@ua/react-native-airship' ;
5+
6+ Airship . addListener ( EventType . PushReceived , ( event ) => {
7+ // Handle push received
8+ console . log ( "PushReceived" ) ;
9+ Airship . channel . editAttributes ( )
10+ . setAttribute ( "ulrich_first_param" , "Ulrich RN 25" )
11+ . apply ( ) ;
12+ Airship . channel . editTags ( )
13+ . addTags ( [ "Ulrich RN Receive 25" ] )
14+ . apply ( )
15+ } ) ;
16+
17+ // Set up event listeners
18+ Airship . addListener ( EventType . NotificationResponse , ( event ) => {
19+ // Handle notification responses
20+ } ) ;
21+
22+ Airship . addListener ( EventType . PushReceived , ( event ) => {
23+ // Handle push received
24+ } ) ;
25+
26+ Airship . addListener ( EventType . ChannelCreated , ( event ) => {
27+ // Handle channel creation
28+ } ) ;
29+
30+ Airship . addListener ( EventType . PushNotificationStatusChangedStatus , ( event ) => {
31+ // Handle push notification status changes
32+ } ) ;
433
534AppRegistry . registerComponent ( appName , ( ) => App ) ;
Original file line number Diff line number Diff line change @@ -31,23 +31,6 @@ export default function App() {
3131 }
3232 } ) ;
3333
34- // Set up event listeners
35- Airship . addListener ( EventType . NotificationResponse , ( event ) => {
36- // Handle notification responses
37- } ) ;
38-
39- Airship . addListener ( EventType . PushReceived , ( event ) => {
40- // Handle push received
41- } ) ;
42-
43- Airship . addListener ( EventType . ChannelCreated , ( event ) => {
44- // Handle channel creation
45- } ) ;
46-
47- Airship . addListener ( EventType . PushNotificationStatusChangedStatus , ( event ) => {
48- // Handle push notification status changes
49- } ) ;
50-
5134 setIsAirshipReady ( true ) ;
5235 } catch ( error ) {
5336 setAirshipError ( error instanceof Error ? error . message : String ( error ) ) ;
Original file line number Diff line number Diff line change @@ -40,5 +40,5 @@ Pod::Spec.new do |s|
4040 end
4141 end
4242
43- s . dependency "AirshipFrameworkProxy" , "14.9 .0"
43+ s . dependency "AirshipFrameworkProxy" , "14.10 .0"
4444end
You can’t perform that action at this time.
0 commit comments