Skip to content

Commit

Permalink
feat!: react native as a source for Data pipelines (#349)
Browse files Browse the repository at this point in the history
Co-authored-by: ami-aman <91549653+ami-aman@users.noreply.github.com>
Co-authored-by: Muhammad Rehan <mrehan.official@gmail.com>
  • Loading branch information
3 people authored Oct 16, 2024
2 parents 06b6bf9 + 8430a5f commit 6665c9f
Show file tree
Hide file tree
Showing 100 changed files with 8,459 additions and 8,258 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-sample-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,16 @@ jobs:
exit 1
fi
# Update the apiKey in the environment file
# Update keys in the environment file
sd "siteId: '.*'" "siteId: '${{ secrets[format('CUSTOMERIO_{0}_WORKSPACE_SITE_ID', matrix.sample-app)] }}'" "$ENV_FILE"
sd "apiKey: '.*'" "apiKey: '${{ secrets[format('CUSTOMERIO_{0}_WORKSPACE_API_KEY', matrix.sample-app)] }}'" "$ENV_FILE"
sd "cdpApiKey: '.*'" "cdpApiKey: '${{ secrets[format('CUSTOMERIO_{0}_WORKSPACE_CDP_API_KEY', matrix.sample-app)] }}'" "$ENV_FILE"
- name: Setup workspace credentials in iOS environment files
working-directory: Apps/${{ matrix.sample-app }}/ios
run: |
cp "Env.swift.example" "Env.swift"
sd 'siteId: String = ".*"' "siteId: String = \"${{ secrets[format('CUSTOMERIO_{0}_WORKSPACE_SITE_ID', matrix.sample-app)] }}\"" "Env.swift"
sd 'apiKey: String = ".*"' "apiKey: String = \"${{ secrets[format('CUSTOMERIO_{0}_WORKSPACE_API_KEY', matrix.sample-app)] }}\"" "Env.swift"
sd 'cdpApiKey: String = ".*"' "cdpApiKey: String = \"${{ secrets[format('CUSTOMERIO_{0}_WORKSPACE_CDP_API_KEY', matrix.sample-app)] }}\"" "Env.swift"
# Make sure to fetch dependencies only after updating version numbers and workspace credentials

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/deploy-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ jobs:
steps:
- uses: actions/checkout@v4

# If using sd on macos, "brew install" works great. for Linux, this is the recommended way.
- name: Install sd CLI to use later in the workflow
# uses: kenji-miyake/setup-sd@v1
uses: levibostian/setup-sd@add-file-extension # Using fork until upstream Action has bug fixed in it.

- name: Deploy git tag via semantic release
uses: cycjimmy/semantic-release-action@v4
id: semantic-release
Expand Down
1 change: 0 additions & 1 deletion Apps/APN/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export default function App() {
prepare();
const inAppEventListener = registerInAppEventListener();

// Remove listeners once unmounted
return () => {
inAppEventListener.remove();
};
Expand Down
23 changes: 9 additions & 14 deletions Apps/APN/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"
apply plugin: "com.google.gms.google-services"
apply plugin: "com.google.gms.google-services" // Google Services plugin

/**
* This is the configuration block to customize your React Native Android app.
* By default you don't need to apply any configuration, just uncomment the lines you need.
*/

react {
/* Folders */
// The root of your project, i.e. where "package.json" lives. Default is '..'
Expand All @@ -17,13 +17,13 @@ react {
// codegenDir = file("../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
// cliFile = file("../node_modules/react-native/cli.js")

/* Variants */
// The list of variants to that are debuggable. For those we're going to
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
// debuggableVariants = ["liteDebug", "prodDebug"]

/* Bundling */
// A list containing the node command and its flags. Default is just 'node'.
// nodeExecutableAndArgs = ["node"]
Expand All @@ -43,7 +43,7 @@ react {
// A list of extra flags to pass to the 'bundle' commands.
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
// extraPackagerArgs = []

/* Hermes Commands */
// The hermes compiler command to run. By default it is 'hermesc'
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
Expand All @@ -65,15 +65,15 @@ def enableProguardInReleaseBuilds = true
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'

android {
ndkVersion rootProject.ext.ndkVersion

compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion

namespace "io.customer.ami"
defaultConfig {
Expand Down Expand Up @@ -108,13 +108,8 @@ android {
dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
implementation("com.facebook.react:flipper-integration")

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.squareup.okhttp3', module:'okhttp'
}

debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
Expand Down
46 changes: 0 additions & 46 deletions Apps/APN/android/app/google-services.json.example

This file was deleted.

This file was deleted.

21 changes: 21 additions & 0 deletions Apps/APN/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,26 @@
<data android:pathPrefix="/dashboard" />
</intent-filter>
</activity>

<!-- Register Customer.io Firebase Messaging Service as we want our SDK to handle all push
notifications. This is not required. However, if you have multiple services added for
handling push notifications, you might need to add this service to ensure all
notifications are handled by Customer.io. Read more:
https://www.customer.io/docs/sdk/react-native/push-notifications/multiple-push-providers/ -->
<service
android:name="io.customer.messagingpush.CustomerIOFirebaseMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>

<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_notification" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/notification_icon"
tools:replace="android:resource" />
</application>
</manifest>

This file was deleted.

22 changes: 22 additions & 0 deletions Apps/APN/android/app/src/main/java/io/customer/ami/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package io.customer.ami;

import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate

class MainActivity : ReactActivity() {

/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
override fun getMainComponentName(): String = "SampleApp"

/**
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
*/
override fun createReactActivityDelegate(): ReactActivityDelegate =
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
}

This file was deleted.

Loading

0 comments on commit 6665c9f

Please sign in to comment.