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
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Airship_minSdkVersion=23
Airship_targetSdkVersion=36
Airship_compileSdkVersion=36
Airship_ndkversion=26.1.10909125
Airship_airshipProxyVersion=14.9.0
Airship_airshipProxyVersion=14.10.0
3 changes: 2 additions & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

<service
android:name="com.urbanairship.reactnative.AirshipHeadlessEventService"
android:exported="false" />
android:exported="false"
android:stopWithTask="true" />

<activity
android:name="com.urbanairship.android.framework.proxy.CustomMessageCenterActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class AirshipHeadlessEventService : HeadlessJsTaskService() {
}

companion object {
private const val TASK_TIMEOUT: Long = 60000
private const val TASK_TIMEOUT: Long = 1000
private const val TASK_KEY = "AirshipAndroidBackgroundEventTask"

fun startService(context: Context): Boolean {
Expand Down
29 changes: 29 additions & 0 deletions example/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
import { AppRegistry } from 'react-native';
import App from './src/App';
import { name as appName } from './app.json';
import Airship, { EventType } from '@ua/react-native-airship';

Airship.addListener(EventType.PushReceived, (event) => {
// Handle push received
console.log("PushReceived");
Airship.channel.editAttributes()
.setAttribute("ulrich_first_param", "Ulrich RN 25")
.apply();
Airship.channel.editTags()
.addTags(["Ulrich RN Receive 25"])
.apply()
});

// Set up event listeners
Airship.addListener(EventType.NotificationResponse, (event) => {
// Handle notification responses
});

Airship.addListener(EventType.PushReceived, (event) => {
// Handle push received
});

Airship.addListener(EventType.ChannelCreated, (event) => {
// Handle channel creation
});

Airship.addListener(EventType.PushNotificationStatusChangedStatus, (event) => {
// Handle push notification status changes
});

AppRegistry.registerComponent(appName, () => App);
17 changes: 0 additions & 17 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,6 @@ export default function App() {
}
});

// Set up event listeners
Airship.addListener(EventType.NotificationResponse, (event) => {
// Handle notification responses
});

Airship.addListener(EventType.PushReceived, (event) => {
// Handle push received
});

Airship.addListener(EventType.ChannelCreated, (event) => {
// Handle channel creation
});

Airship.addListener(EventType.PushNotificationStatusChangedStatus, (event) => {
// Handle push notification status changes
});

setIsAirshipReady(true);
} catch (error) {
setAirshipError(error instanceof Error ? error.message : String(error));
Expand Down
2 changes: 1 addition & 1 deletion react-native-airship.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ Pod::Spec.new do |s|

install_modules_dependencies(s)

s.dependency "AirshipFrameworkProxy", "14.9.0"
s.dependency "AirshipFrameworkProxy", "14.10.0"
end