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: 2 additions & 0 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<application
android:name=".MainApplication"
Expand Down
3 changes: 3 additions & 0 deletions example/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ edgeToEdgeEnabled=false
# This is useful for testing new features or bug fixes before they are released.
# Set to 'local' to use the local version of the SDK.
# cioSDKVersionAndroid=local

# Enable Customer.io Location module for the example app (used to verify location wiring).
customerio_location_enabled=true
23 changes: 16 additions & 7 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,27 @@ load "/tmp/override_cio_sdk.rb"
# end of internal Customer.io testing code
# -------------

# Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command("node", ["-p",
'require.resolve(
"react-native/scripts/react_native_pods.rb",
{paths: [process.argv[1]]},
)', __dir__]).strip
# Resolve scripts with node to allow for hoisting
def node_require(script)
require Pod::Executable.execute_command('node', ['-p',
"require.resolve(
'#{script}',
{paths: [process.argv[1]]},
)", __dir__]).strip
end

node_require('react-native/scripts/react_native_pods.rb')
node_require('react-native-permissions/scripts/setup.rb')

require_relative "../scripts/ios_project_setup_utils.rb"

platform :ios, min_ios_version_supported
prepare_react_native_project!

setup_permissions([
'LocationWhenInUse',
])

push_provider = (ENV["PUSH_PROVIDER"] || "apn").downcase

app_target_name = "SampleApp"
Expand Down Expand Up @@ -51,7 +60,7 @@ target app_target_name do
:path => config[:reactNativePath],
:app_path => "#{installation_root}/..",
)
pod "customerio-reactnative/#{push_provider}", :path => cio_package_path
pod "customerio-reactnative", :path => cio_package_path, :subspecs => [push_provider, "location"]
# install_non_production_ios_sdk_local_path(local_path: '~/code/customerio-ios/', is_app_extension: false, push_service: push_provider)
# install_non_production_ios_sdk_git_branch(branch_name: 'feature/wrappers-inline-support', is_app_extension: false, push_service: push_provider)

Expand Down
2 changes: 2 additions & 0 deletions example/ios/SampleApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
</dict>
<key>RCTNewArchEnabled</key>
<true/>
<key>NSLocationWhenInUseUsageDescription</key>
<string>This app uses your location to test the Customer.io location module.</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CFBundleURLTypes</key>
Expand Down
31 changes: 31 additions & 0 deletions example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "sh -c 'args=\"$*\"; sim=${args#*--simulator }; react-native run-ios --simulator=\"$sim\"' _",
"ios": "react-native run-ios",
"pods": "bundle exec pod install --project-directory=ios",
"lint": "eslint .",
"start": "react-native start",
Expand All @@ -18,6 +18,7 @@
"dependencies": {
"@react-native-async-storage/async-storage": "^2.2.0",
"@react-native-clipboard/clipboard": "^1.16.0",
"@react-native-community/geolocation": "^3.4.0",
"@react-navigation/bottom-tabs": "^7.4.7",
"@react-navigation/native": "^7.1.14",
"@react-navigation/native-stack": "^7.3.20",
Expand All @@ -27,6 +28,7 @@
"react-native-device-info": "^14.0.4",
"react-native-flash-message": "^0.4.2",
"react-native-get-random-values": "^1.11.0",
"react-native-permissions": "^5.0.0",
"react-native-safe-area-context": "^5.6.0",
"react-native-screens": "^4.11.1",
"react-native-snackbar": "^2.9.0",
Expand Down
2 changes: 2 additions & 0 deletions example/src/navigation/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const CustomDeviceAttrScreenName = 'Device Attributes' as const;
export const InternalSettingsScreenName = 'Internal Settings' as const;
export const InlineExamplesScreenName = 'Inline Examples' as const;
export const InboxMessagesScreenName = 'Inbox Messages' as const;
export const LocationScreenName = 'Location' as const;

export type NavigationStackParamList = {
[SettingsScreenName]: undefined;
Expand All @@ -24,6 +25,7 @@ export type NavigationStackParamList = {
[InternalSettingsScreenName]: undefined;
[InlineExamplesScreenName]: undefined;
[InboxMessagesScreenName]: undefined;
[LocationScreenName]: undefined;
};

export type NavigationProps = NavigationProp<NavigationStackParamList>;
Expand Down
11 changes: 11 additions & 0 deletions example/src/screens/content-navigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
InboxMessagesScreenName,
InlineExamplesScreenName,
InternalSettingsScreenName,
LocationScreenName,
LoginScreenName,
NavigationCallbackContext,
NavigationStackParamList,
Expand All @@ -22,6 +23,7 @@ import {
InboxMessagesScreen,
InlineExamplesScreen,
InternalSettingsScreen,
LocationScreen,
LogingScreen,
SettingsScreen,
TrackScreen,
Expand Down Expand Up @@ -128,6 +130,15 @@ export const ContentNavigator = ({ appName }: { appName: string }) => {
headerBackVisible: true,
}}
/>
<Stack.Screen
name={LocationScreenName}
component={LocationScreen}
options={{
title: 'Location Test',
headerBackButtonDisplayMode: 'minimal',
headerBackVisible: true,
}}
/>
</Stack.Navigator>
</ScreensContext.Provider>
);
Expand Down
5 changes: 5 additions & 0 deletions example/src/screens/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
CustomProfileAttrScreenName,
InboxMessagesScreenName,
InlineExamplesScreenName,
LocationScreenName,
NavigationCallbackContext,
NavigationScreenProps,
} from '@navigation';
Expand Down Expand Up @@ -76,6 +77,10 @@ export const HomeScreen = ({
navigation.navigate(InboxMessagesScreenName);
}}
/>
<Button
title="Location (test)"
onPress={() => navigation.navigate(LocationScreenName)}
/>
</View>
</ScrollView>
<View style={styles.spacer}>
Expand Down
1 change: 1 addition & 0 deletions example/src/screens/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export * from './home';
export * from './inbox-messages';
export * from './inline-examples';
export * from './internal-settings';
export * from './location';
export * from './login';
export * from './settings';
export * from './track';
Loading
Loading