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
21 changes: 10 additions & 11 deletions example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,30 @@ 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")
// 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()
Airship.channel.editTags().addTags(['Ulrich RN Receive 25']).apply();
});

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

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

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

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

AppRegistry.registerComponent(appName, () => App);
2 changes: 1 addition & 1 deletion example/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ const config = {
},
};

module.exports = mergeConfig(getDefaultConfig(__dirname), config);
module.exports = mergeConfig(getDefaultConfig(__dirname), config);
11 changes: 8 additions & 3 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { useEffect, useState } from 'react';
import { View, Text, ActivityIndicator, StatusBar, useColorScheme } from 'react-native';
import {
View,
Text,
ActivityIndicator,
StatusBar,
useColorScheme,
} from 'react-native';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import Airship from '@ua/react-native-airship';
import TabNavigator from './navigation/TabNavigator';
Expand Down Expand Up @@ -49,8 +55,7 @@ export default function App() {

return (
<SafeAreaProvider>
<TabNavigator />
<TabNavigator />
</SafeAreaProvider>
);
}

92 changes: 46 additions & 46 deletions example/src/Styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { StyleSheet } from 'react-native';

/**
* Airship Example App Styles
*
*
* This file contains all styles for the Airship Example App, organized by usage.
* - Common styles are shared across multiple screens
* - Each section-specific styles are grouped together
Expand All @@ -14,26 +14,26 @@ import { StyleSheet } from 'react-native';
// Colors - design system
const Colors = {
// Primary palette
primaryDark: '#001f9e', // Dark blue
primary: '#004bff', // Light blue
accent: '#f1084f', // Red
success: '#6ca15f', // Green
primaryDark: '#001f9e', // Dark blue
primary: '#004bff', // Light blue
accent: '#f1084f', // Red
success: '#6ca15f', // Green

// Neutral palette
text: '#020202', // Black text
text: '#020202', // Black text
textSecondary: '#666666', // Secondary text
textMuted: '#94a3b8', // Muted text
background: '#F8F8F8', // Background gray
textMuted: '#94a3b8', // Muted text
background: '#F8F8F8', // Background gray
backgroundAlt: '#f1f5f9', // Alternative background
cardBackground: '#FFFFFF',// Card background
border: '#E0E0E0', // Border color
borderLight: '#e2e8f0', // Light border
cardBackground: '#FFFFFF', // Card background
border: '#E0E0E0', // Border color
borderLight: '#e2e8f0', // Light border

// Semantic colors
error: '#D32F2F',
warning: '#FFEBEE',
overlay: 'rgba(255, 255, 255, 0.7)',

// Preference Center specific
switchTrackActive: '#10b981',
switchTrackInactive: '#cbd5e1',
Expand Down Expand Up @@ -107,7 +107,7 @@ export default StyleSheet.create({
flexDirection: 'row',
alignItems: 'center',
},

/**
* Card & Section Components
*/
Expand Down Expand Up @@ -137,7 +137,7 @@ export default StyleSheet.create({
...Typography.body,
color: Colors.textSecondary,
},

/**
* Loading & Status Indicators
*/
Expand All @@ -157,9 +157,9 @@ export default StyleSheet.create({
alignItems: 'center',
justifyContent: 'center',
},

/**
* Warning & Error Components
* Warning & Error Components
*/
warningContainer: {
backgroundColor: Colors.warning,
Expand Down Expand Up @@ -190,7 +190,7 @@ export default StyleSheet.create({
warningBodyText: {
color: Colors.border,
},

/**
* Form Elements
*/
Expand Down Expand Up @@ -223,7 +223,7 @@ export default StyleSheet.create({
fontWeight: 'bold',
fontSize: 14,
},
// Standard button
// Standard button
button: {
backgroundColor: Colors.primary,
borderRadius: 8,
Expand All @@ -234,7 +234,7 @@ export default StyleSheet.create({
color: Colors.cardBackground,
fontWeight: 'bold',
},

/**
* List Items & Chips
*/
Expand Down Expand Up @@ -267,7 +267,7 @@ export default StyleSheet.create({
color: Colors.text,
marginRight: Spacing.s,
},

/**
* HOME SCREEN
*/
Expand Down Expand Up @@ -304,7 +304,7 @@ export default StyleSheet.create({
fontSize: 14,
fontWeight: '600',
},

// Channel ID
channelIdContainer: {
backgroundColor: '#F5F5F5',
Expand All @@ -319,7 +319,7 @@ export default StyleSheet.create({
fontSize: 14,
fontFamily: 'monospace',
},

// Push Notifications
pushContainer: {
padding: Spacing.s,
Expand All @@ -334,7 +334,7 @@ export default StyleSheet.create({
fontWeight: 'bold',
fontSize: 16,
},

// Named User
namedUserContainer: {
padding: Spacing.s,
Expand All @@ -343,7 +343,7 @@ export default StyleSheet.create({
marginBottom: Spacing.s,
fontSize: 14,
},

// Tags
tagsContainer: {
padding: Spacing.s,
Expand Down Expand Up @@ -379,17 +379,17 @@ export default StyleSheet.create({
fontSize: 14,
fontWeight: 'bold',
},

// Live Activities
liveButtonRow: {
marginBottom: Spacing.m,
},

/**
* MESSAGE CENTER SCREEN
*/
// No specific styles - using shared list components

/**
* PREFERENCE CENTER SCREEN
*/
Expand All @@ -406,7 +406,7 @@ export default StyleSheet.create({
paddingTop: Spacing.m,
paddingBottom: 32,
},

// Loading state
pcLoadingContainer: {
flex: 1,
Expand All @@ -420,7 +420,7 @@ export default StyleSheet.create({
color: Colors.textSecondary,
fontWeight: '500',
},

// Section header
pcSectionHeader: {
paddingTop: Spacing.xl,
Expand All @@ -442,7 +442,7 @@ export default StyleSheet.create({
pcSectionSpacer: {
height: Spacing.m,
},

// Subscription card
pcSubscriptionCard: {
backgroundColor: Colors.cardBackground,
Expand All @@ -459,7 +459,7 @@ export default StyleSheet.create({
alignItems: 'center',
justifyContent: 'space-between',
},

// Item text
pcItemTextContainer: {
flex: 1,
Expand All @@ -477,7 +477,7 @@ export default StyleSheet.create({
color: Colors.textSecondary,
lineHeight: 20,
},

// Switch
pcSwitchContainer: {
flexDirection: 'row',
Expand All @@ -494,7 +494,7 @@ export default StyleSheet.create({
pcSwitchLabelActive: {
color: Colors.switchTrackActive,
},

// Scope buttons
pcScopeContainer: {
flexDirection: 'row',
Expand Down Expand Up @@ -531,7 +531,7 @@ export default StyleSheet.create({
color: Colors.cardBackground,
fontWeight: '700',
},

// Alert card
pcAlertCard: {
backgroundColor: Colors.alertBackground,
Expand Down Expand Up @@ -563,15 +563,15 @@ export default StyleSheet.create({
color: Colors.textSecondary,
lineHeight: 20,
},

// Separators
pcItemSeparator: {
height: Spacing.m,
},
pcSectionSeparator: {
height: Spacing.xs,
},

// Empty state
pcEmptyContainer: {
flex: 1,
Expand Down Expand Up @@ -621,7 +621,7 @@ export default StyleSheet.create({
fontSize: 16,
fontWeight: '600',
},

/**
* CUSTOM EVENTS SCREEN
*/
Expand Down Expand Up @@ -663,7 +663,7 @@ export default StyleSheet.create({
flex: 0.6,
marginRight: Spacing.s,
},

// Action buttons
removeButton: {
width: 30,
Expand All @@ -690,7 +690,7 @@ export default StyleSheet.create({
fontWeight: 'bold',
fontSize: 16,
},

// Examples section
examplesContainer: {
flexDirection: 'row',
Expand All @@ -713,7 +713,7 @@ export default StyleSheet.create({
exampleDescription: {
...Typography.body,
},

/**
* MISCELLANEOUS / LEGACY SUPPORT
*/
Expand Down Expand Up @@ -795,7 +795,7 @@ export default StyleSheet.create({
justifyContent: 'flex-end',
marginBottom: 36,
},

/**
* UI ELEMENTS
*/
Expand Down Expand Up @@ -843,7 +843,7 @@ export default StyleSheet.create({
alignItems: 'center',
backgroundColor: Colors.border,
},

/**
* APP COMPONENT STYLES
*/
Expand Down Expand Up @@ -877,7 +877,7 @@ export default StyleSheet.create({
textAlign: 'center',
color: Colors.text,
},

/**
* EMBEDDED VIEWS SCREEN
*/
Expand Down Expand Up @@ -1075,4 +1075,4 @@ export default StyleSheet.create({
textAlign: 'center',
lineHeight: 18,
},
});
});
Loading
Loading