Skip to content

Commit

Permalink
test config apn
Browse files Browse the repository at this point in the history
  • Loading branch information
mrehan27 committed Oct 16, 2024
1 parent 8430a5f commit a8359ef
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 20 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/build-sample-apps.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Build sample apps

on:
pull_request: # build sample apps for every commit pushed to an open pull request (including drafts)
push:
branches: [ main, feature/* ]

concurrency: # cancel previous workflow run if one exists.
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -59,7 +57,7 @@ jobs:
# List all sample apps you want to have compiled.
# List item is name of directory inside of "Apps" directory for the corresponding app to compile.
- "APN"
- "FCM"
# - "FCM"
defaults:
run:
working-directory: apps/${{ matrix.sample-app }}
Expand Down Expand Up @@ -184,15 +182,15 @@ jobs:
with:
xcode-version: ${{ env.XCODE_VERSION }}

- name: Build and upload iOS app via Fastlane
id: ios_build
uses: maierj/[email protected]
with:
subdirectory: Apps/${{ matrix.sample-app }}
lane: "ios build"
env:
GOOGLE_CLOUD_MATCH_READONLY_SERVICE_ACCOUNT_B64: ${{ secrets.GOOGLE_CLOUD_MATCH_READONLY_SERVICE_ACCOUNT_B64 }}
FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT_CREDS_B64: ${{ secrets.FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT_CREDS_B64 }}
# - name: Build and upload iOS app via Fastlane
# id: ios_build
# uses: maierj/[email protected]
# with:
# subdirectory: Apps/${{ matrix.sample-app }}
# lane: "ios build"
# env:
# GOOGLE_CLOUD_MATCH_READONLY_SERVICE_ACCOUNT_B64: ${{ secrets.GOOGLE_CLOUD_MATCH_READONLY_SERVICE_ACCOUNT_B64 }}
# FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT_CREDS_B64: ${{ secrets.FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT_CREDS_B64 }}

- name: Check build statuses and mark failure
run: |
Expand Down
24 changes: 16 additions & 8 deletions Apps/APN/src/services/CustomerIOService.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,30 @@ import {
CustomerIO,
CioLogLevel,
InAppMessageEventType,
CioRegion,
PushClickBehaviorAndroid,
} from 'customerio-reactnative';

export const initializeCustomerIoSDK = (sdkConfig) => {
const config = {
cdpApiKey: sdkConfig.cdpApiKey, // Mandatory
migrationSiteId: sdkConfig.siteId, // For migration
trackApplicationLifecycleEvents: sdkConfig.trackAppLifecycleEvents,
autoTrackDeviceAttributes: sdkConfig.autoTrackDeviceAttributes,
cdpApiKey: 'TestCDPAPIKey',
migrationSiteId: 'TestMigrationSiteId',
region: CioRegion.EU,
logLevel: CioLogLevel.Info,
flushAt: 47,
flushInterval: 61,
trackApplicationLifecycleEvents: false,
autoTrackDeviceAttributes: false,
inApp: {
siteId: sdkConfig.siteId,
siteId: 'TestSiteId',
},
push: {
android: {
pushClickBehavior: PushClickBehaviorAndroid.ResetTaskStack,
},
},
};

if (sdkConfig.debugMode) {
config.logLevel = CioLogLevel.Debug;
}
CustomerIO.initialize(config);
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.customer.reactnative.sdk

import android.app.Application
import android.util.Log
import com.facebook.react.bridge.Promise
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactContextBaseJavaModule
Expand Down Expand Up @@ -45,6 +46,8 @@ class CustomerIOReactNativeModule(
val regionRawValue = packageConfig.getTypedValue<String>(Keys.Config.REGION)
val region = regionRawValue.let { Region.getRegion(it) }

Log.d("[CIO]", "[Test] initialize: $cdpApiKey")
Log.d("[CIO]", "[Test] packageConfig: $packageConfig")
CustomerIOBuilder(
applicationContext = reactApplicationContext.applicationContext as Application,
cdpApiKey = cdpApiKey
Expand Down Expand Up @@ -78,6 +81,7 @@ class CustomerIOReactNativeModule(
region = region
)
}
Log.d("[CIO]", "[Test] CustomerIOBuilder: $this")
}.build()

logger.info("Customer.io instance initialized successfully from app")
Expand Down

0 comments on commit a8359ef

Please sign in to comment.