Coder Social home page Coder Social logo

adobe / aepsdk-react-native Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 22.0 5.75 MB

A wrapper around the iOS and Android AEP mobile SDK to allow for integration with React Native applications.

License: Apache License 2.0

JavaScript 0.61% Java 32.27% Objective-C 16.89% Ruby 2.21% TypeScript 44.19% Objective-C++ 0.77% Swift 2.07% Kotlin 0.98% C 0.02%

aepsdk-react-native's Introduction

aepsdk-react-native

license CircleCI

About this project

This repository is a monorepo and contains a collection of React Native modules for Adobe Experience Platform Mobile SDK as listed below. These modules can be found in the packages directory.

Package Name Latest Version Native Extension
@adobe/react-native-aepcore (required) npm version npm downloads Mobile Core
@adobe/react-native-aepuserprofile npm version npm downloads Profile
@adobe/react-native-aepedge npm version npm downloads Edge
@adobe/react-native-aepedgeidentity npm version npm downloads EdgeIdentity
@adobe/react-native-aepedgeconsent npm version npm downloads EdgeConsent
@adobe/react-native-aepedgebridge npm version npm downloads EdgeBridge
@adobe/react-native-aepmessaging npm version npm downloads Messaging
@adobe/react-native-aepassurance npm version npm downloads Assurance
@adobe/react-native-aepoptimize npm version npm downloads Optimize
@adobe/react-native-aepplaces npm version npm downloads Places
@adobe/react-native-aeptarget npm version npm downloads Target
@adobe/react-native-aepcampaignclassic npm version npm downloads CampaignClassic

Note

Since version 5.0.0 of the Adobe React Native SDK, all React Native libraries that share the same major version are compatible with each other.

Note

The React Native libraries within this repository are specifically designed to support the Android and iOS platforms only.

Requirements

  • React Native

Requires React Native (0.60.0 and above)

  • Xcode

To submit iOS apps to the App Store, you must build them using Xcode 15 or later, as required by Apple.

iOS Privacy Manifest

Important

Adobe Experience Platform React Native 6.x libraries now depend on Experience Platform iOS 5.x SDKs, which have been updated to align with Apple's latest guidelines on privacy manifest. For further details on how Apple's privacy-related announcements affect the Adobe mobile SDK for iOS, please refer to this document.

React Native New Architecture Support

React Native 0.7x introduced support for a new architecture. We don't yet support the new architecture.

Installation

You need to install Adobe Experience Platform Mobile SDK with npm packages and configure the native Android/iOS project in your React Native project.

Note: If you are new to React Native, we suggest you follow the React Native Getting Started page before continuing.

Install AEP npm packages

Adobe Experience Platform Mobile SDK packages can be installed from npm command.

Note: @adobe/react-native-aepcore is required to be installed.

Install the @adobe/react-native-aep{extension} package:

cd MyReactApp
npm install @adobe/react-native-aep{extension}

Alternatively, include the Adobe Experience Platform npm packages as dependencies in the app’s package.json.

The following code snippet shows for Mobile Core and Edge Network extensions as an example in package.json:

...
"dependencies": {
    "react-native": "0.72.5",
    "@adobe/react-native-aepcore": "^6.0.0", //core is required and includes aepcore, aepsignal, aeplifecycle, aepidentity libraries
    "@adobe/react-native-aepedge": "^6.0.0",
    "@adobe/react-native-aepedgeidentity": "^6.0.0",
    "@adobe/react-native-aepedgeconsent": "^6.0.0",
...
},

Inside of the app directory, run

#if using node package manager
npm install

or

#if using yarn package manager
yarn install
ios development

For iOS development, after installing the plugins from npm, download the pod dependencies by running the following command:

cd ios && pod install && cd ..

To update native dependencies to latest available versions, run the following command:

cd ios && pod update && cd ..

Initializing

Initializing the SDK should be done in native code inside your AppDelegate (iOS) and MainApplication (Android). The following code snippets demonstrate how to install and register the AEP Mobile Core and Edge Network extensions. Documentation on how to initialize each extension can be found in ./packages/{extension}/README.md.

iOS
//AppDelegate.h
@import AEPCore;
@import AEPServices;
@import AEPLifecycle;
@import AEPSignal;
@import AEPEdge;
@import AEPEdgeIdentity;
@import AEPEdgeConsent;
...
//AppDelegate.m
...
@implementation AppDelegate
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  [AEPMobileCore setLogLevel: AEPLogLevelDebug];
  [AEPMobileCore configureWithAppId:@"yourAppID"];

  const UIApplicationState appState = application.applicationState;

  [AEPMobileCore registerExtensions: @[
      AEPMobileLifecycle.class,
      AEPMobileSignal.class,
      AEPMobileEdge.class,
      AEPMobileEdgeIdentity.class,
      AEPMobileEdgeConsent.class,
  ] completion:^{
    if (appState != UIApplicationStateBackground) {
       [AEPMobileCore lifecycleStart:nil}];
    }
  }];
  return YES;
}

@end

To enable the Lifecycle metrics, implement the Lifecycle APIs

Hint : While running iOS application after Adobe Experience Platform SDK installation. If you have build error that states: "ld: warning: Could not find or use auto-linked library 'swiftCoreFoundation'" This is because Adobe Experience Platform SDK now requires the app uses swift interfaces. Add a dummy .swift file to your project to embed the swift standard libs. See the SampleApp presented in this repo for example.

Android:
//MainApplication.java
import com.adobe.marketing.mobile.AdobeCallback;
import com.adobe.marketing.mobile.Extension;
import com.adobe.marketing.mobile.LoggingMode;
import com.adobe.marketing.mobile.MobileCore;
import com.adobe.marketing.mobile.Lifecycle;
import com.adobe.marketing.mobile.Signal;
import com.adobe.marketing.mobile.Edge;
import com.adobe.marketing.mobile.edge.consent.Consent;
...
import android.app.Application;
...
public class MainApplication extends Application implements ReactApplication {
  ...
  @Override
  public void on Create(){
    super.onCreate();
    ...
    MobileCore.setApplication(this);
    MobileCore.setLogLevel(LoggingMode.DEBUG);
    MobileCore.configureWithAppID("yourAppID");
    List<Class<? extends Extension>> extensions = Arrays.asList(
                Lifecycle.EXTENSION,
                Signal.EXTENSION,
                Edge.EXTENSION,
                com.adobe.marketing.mobile.edge.identity.Identity.EXTENSION,
                Consent.EXTENSION);
    MobileCore.registerExtensions(extensions, o -> {
      Log.d(LOG_TAG, "AEP Mobile SDK is initialized");
      MobileCore.lifecycleStart(null);
      //enable this for Lifecycle. See Note for collecting Lifecycle metrics.
    });
  }
}

To enable the Lifecycle metrics, implement the Lifecycle APIs

Migration guide

See migration.md for guidance on migrating from ACP React Native libraries.

Troubleshooting and Known issues

  1. Getting error when building on iOS Xcode
Use of '@import' when C++ modules are disabled, consider using -fmodules and -fcxx-modules

Refer to the solution here.

  1. Getting error when building on iOS
Underlying Objective-C module 'AEPRulesEngine' not found

Refer to the solution here.

Contributing

Contributions are welcomed! See CONTRIBUTING and development.md guides for more information.

Licensing

This project is licensed under the Apache V2 License. See LICENSE for more information.

aepsdk-react-native's People

Contributors

ahmyr avatar cacheung avatar dsoffiantini avatar emdobrin avatar kevindice avatar praveek avatar pravinpk avatar rymorale avatar sbenedicadb avatar shtomar-adb avatar swarna04 avatar yangyansong-adbe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aepsdk-react-native's Issues

Build fails on gradle@8 - missing namespace

Expected Behaviour

App should build.

Actual Behaviour

Build fails.

Reproduce Scenario (including but not limited to)

Build android app

Steps to Reproduce

  • use react-native 0.72.7
  • build android

Platform and Version

Sample Code that illustrates the problem

// react-native-assurance-aepassurance/android/build.gradle
android {
    compileSdkVersion safeExtGet('compileSdkVersion', 33)
    // namespace "com.adobe.marketing.mobile.reactnative.assurance" must be added to support gradle@8
    defaultConfig {
        minSdkVersion safeExtGet('minSdkVersion', 19)
        targetSdkVersion safeExtGet('targetSdkVersion', 33)
        versionCode 1
        versionName "1.0"
    }
    lintOptions {
        abortOnError false
    }
}

Logs taken while reproducing problem

> Configure project :adobe_react-native-aepassurance
WARNING: Using flatDir should be avoided because it doesn't support any meta-data formats.
5 actionable tasks: 5 executed

info 💡 Tip: Make sure that you have set up your development environment correctly, by running react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':adobe_react-native-aepassurance'.
> Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
   > Namespace not specified. Specify a namespace in the module's build file. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.

     If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant.

IOS build fails: underlying Objective-C module 'AEPServices' not found

Hello,
I see IOS build error showing this:

  • underlying Objective-C module 'AEPServices' not found.
  • /Users/expo/workingdir/build/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/AEPServices.build/Objects-normal/x86_64/AEPServices.private.swiftinterface:5:19
  • // swift-interface-format-version: 1.0
    | ^ failed to verify module interface of 'AEPServices' due to the errors above; the textual interface may be broken by project
    issues or a compiler bug

How can I setup cusPreferredLanguage

Hi,

so we have a situation where we need to set language for the subscriber. In the same table where we can find cloid ID, registration token, etc., there is a field Language (cusPreferredLanguage). How to set this field from react-native programmatically (and update it if language changes)?

Edge.sendEvent callback doesn't deliver all information

I'm having issues extracting the Edge Tracking Response in my RN code.
While native code receives the data correctly, the Edge.sendEvent callback in RN does not give all information.

Expected Behaviour

Edge Tracking Event response is available in RN code

Actual Behaviour

Cropped response

[{"type":"activation:pull","payload":[{"destinationId":"XXX","type":"profileLookup","alias":"XXX"}]}]

Steps to Reproduce

  1. Define an Edge Segment which qualifies if below event is fired
  2. Ingest an experience event from the app
  3. Extract response

Platform and Version

Android @adobe/[email protected]

Sample Code that illustrates the problem

    Edge.sendEvent(experienceEvent).then(function (value) {
      console.log("event response:" + JSON.stringify(value))

Logs taken while reproducing problem

Looking at adb logcat I can see the expected response coming. (Look at "segments" below)

02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK: Edge - NetworkResponseHandler - Received server response:
02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK: {
02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK:   "requestId": "d68d1e17-a119-4cb4-8e74-b6c12152d2ba",
02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK:   "handle": [
02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK:     {
02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK:       "payload": [
02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK:         {
02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK:           "type": "profileLookup",
02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK:           "destinationId": "XXX",
02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK:           "alias": "XXXX",
02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK:           "segments": [
02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK:             {
02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK:               "id": "54617704-6afc-42c8-8be5-4255a03cd6b9"
02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK:             },
02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK:             {
02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK:               "id": "88122b80-8081-4caa-9e46-b9bc0d021857"
02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK:             }
02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK:           ]
02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK:         }
02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK:       ],
02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK:       "type": "activation:pull",
02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK:       "eventIndex": 0
02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK:     }
02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK:   ]
02-16 10:34:11.831 15800 15893 D AdobeExperienceSDK: }

Add set/get support for Edge location hint

  • update the Edge wrapper to support the set/getLocationHint available in the native SDK
  • update api docs
  • add tests for the new APIs
  • update sample app with set/getLocationHint

React Native Messaging release testing

Release testing for React Native Messaging 5.0.

Expected Behaviour

Actual Behaviour

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Platform and Version

Sample Code that illustrates the problem

Logs taken while reproducing problem

Add async error handling in native code

Expected Behaviour

For async API calls, the native SDKs have provided the AdobeCallbackWithError (Android) and the Error (iOS) classes to get error notification for operation timeout or other internal errors. Update React Native Android/iOS implementation code to handle internal errors.
https://aep-sdks.gitbook.io/docs/foundation-extensions/mobile-core/mobile-core-api-reference#adobecallbackwitherror

https://github.com/adobe/aepsdk-core-ios/blob/ee0aff1670b4ef283f62b1ee993e8bf611f31b6b/AEPCore/Sources/core/MobileCore%2BConfiguration.swift#L79

Actual Behaviour

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Platform and Version

Sample Code that illustrates the problem

Logs taken while reproducing problem

Issues Imports/AppDelegate file

Hello,

I am currently attempting to implement the AEP SDK into a React Native project.

React Native: v69.1
Xcode: v15.0

The issue I am running into is during the initialization process with iOS. I am receiving the following error messages inside my AppDelegate.h file while using the code snippets provided in the documentation.

AppDelegate.h
image

I was also wondering if the code snippet provided for the AppDelegate.m file would also work in RN's new architecture that utilizes the .mm format instead.

Any help would be greatly appreciated! :)

Thanks,
Adam

Support for react native >= 0.73.x

Expected Behaviour

supports react native 0.73.x

Actual Behaviour

does not support react native 0.73.x

Platform and Version

React native >= 0.73.x

According to the readme's doc this package Requires React Native (0.60.0 - 0.72.x).
Is there any plan on support >= 0.73.x

Thanks in advance.

Broken Android build: Non-pinned native packages result in dependency which is not yet published

Expected Behaviour

My Android app continues to build because I have not changed any Adobe dependencies since May 16.

Actual Behaviour

The packages in this repository reference broad ranges of the underlying Android native code packages resulting in non-consensual upgrades, exposing my team's project to risk through non-deterministic builds. At least one of the native code packages is specifically requiring com.adobe.marketing.mobile:core:2.2.0 which has not been published yet, so our Android build has begun to fail.

This is a critical blocker.

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not find com.adobe.marketing.mobile:core:2.2.0.
     Required by:
         project :app > project :adobe_react-native-aepcore
   > Could not find com.adobe.marketing.mobile:core:2.2.0.
     Required by:
         project :app > com.adobe.marketing.mobile:assurance:2.1.0
         project :app > com.adobe.marketing.mobile:signal:2.0.1
         project :app > com.adobe.marketing.mobile:target:2.0.0
   > Could not find com.adobe.marketing.mobile:core:2.2.0.
     Required by:
         project :app > com.adobe.marketing.mobile:identity:2.0.2
   > Could not find com.adobe.marketing.mobile:core:2.2.0.
     Required by:
         project :app > com.adobe.marketing.mobile:lifecycle:2.0.2-SNAPSHOT:20230427.221352-1
   > Could not find com.adobe.marketing.mobile:core:2.2.0.
     Required by:
         project :app > com.adobe.marketing.mobile:edge:2.1.0
         project :app > com.adobe.marketing.mobile:edgeconsent:2.0.0
         project :app > com.adobe.marketing.mobile:edgeidentity:2.0.0
         project :app > com.adobe.marketing.mobile:optimize:2.0.0
         project :app > com.adobe.marketing.mobile:places:2.0.0
         project :app > com.adobe.marketing.mobile:userprofile:2.0.0

Reproduce Scenario (including but not limited to)

Build an Android app with the following dependencies:

    "@adobe/react-native-aepassurance": "4.0.0",
    "@adobe/react-native-aepcore": "2.0.0",
    "@adobe/react-native-aepedge": "2.0.0",
    "@adobe/react-native-aepedgeconsent": "2.0.0",
    "@adobe/react-native-aepedgeidentity": "2.0.0",
    "@adobe/react-native-aepoptimize": "2.0.0",
    "@adobe/react-native-aepplaces": "2.0.0",
    "@adobe/react-native-aeptarget": "2.0.0",
    "@adobe/react-native-aepuserprofile": "2.0.0",

Steps to Reproduce

..

Platform and Version

Android

Sample Code that illustrates the problem

Logs taken while reproducing problem

MobileCore.resetIdentities() leads to TWO ECIDs in edgeidentity

Hello, when I try to reset the ECID using MobileCore.resetIdentities(); something strange happens:

Log output when calling "MobileCore.resetIdentities();"

04-11 17:58:34.428   978  1150 D AdobeExperienceSDK: IdentityExtension - generateURLEncodedValuesCustomerIdString : No Visitor ID exists in the provided list to generate for URL.
04-11 17:58:34.428   978  1150 D AdobeExperienceSDK: IdentityHitsDatabase - updatePrivacyStatus : Privacy Status was opted-in, so attempting to send all the queued Identity hits from database.
04-11 17:58:34.442   978  1150 D AdobeExperienceSDK: IdentityHitsDatabase - IdentityHitsDatabase.queue : Queued an identity sync call with URL: (https://dpm.demdex.net/id?d_ver=2&d_rtbd=json&d_orgid=XXX%40AdobeOrg&d_mid=18594564454102280516426503658680704367) resulted from the event: (6dc3c852-448f-4157-81e9-b3431b305bfc).
04-11 17:58:34.445   978  1151 D AdobeExperienceSDK: EdgeIdentity - IdentityState - Identity direct ECID updated to '18594564454102280516426503658680704367', updating the IdentityMap
04-11 17:58:34.450   978  2581 D AdobeExperienceSDK: IdentityExtension - IdentityHitsDatabase.process : Sending request: (https://dpm.demdex.net/id?d_ver=2&d_rtbd=json&d_orgid=XXX%40AdobeOrg&d_mid=18594564454102280516426503658680704367).
04-11 17:58:34.450   978  1150 D AdobeExperienceSDK: IdentityExtension - handleIdentityRequestReset: Did reset identifiers and queued force sync event.
04-11 17:58:34.451   978  2584 D AdobeExperienceSDK: HttpConnectionHandler - Connecting to URL https://dpm.demdex.net/id?d_ver=2&d_rtbd=json&d_orgid=XXX%40AdobeOrg&d_mid=18594564454102280516426503658680704367 (GET)
04-11 17:58:34.684   978  2581 D AdobeExperienceSDK: IdentityExtension - handleNetworkResponseMap : ECID Service returned (mid: 18594564454102280516426503658680704367, blob: j8Odv6LonN4r3an7LhD3WZrU1bUpAkFkkiY1ncBR96t2PTI, hint: 6, ttl: 604800).

When I now click "EDGEIDENTITY/GETIDENTIES" button in the app the following is printed/returned:

04-11 18:00:03.971   978  1232 I ReactNativeJS: AdobeExperienceSDK: Identity.getIdentities {"identityMap":{"ECID":[{"id":"08827957854277672686629948177970628054","authenticatedState":"ambiguous","primary":false},{"id":"18594564454102280516426503658680704367","authenticatedState":"ambiguous","primary":false}]}}

As you can see getIdentities now has TWO ECIDs which will be transmitted when calling "Edge.sendEvent".
How can this be fixed?

Testcode:
mdonke@4675f03

React native getExperienceCloudId returns time out error.

getExperienceCloudId returning "time out error" form React native.

Adobe React native setup done based on the documentation. Please Let me know any library and configuration is missing.

React Native :

"dependencies": {
    "@adobe/react-native-aepcore": "^2.0.0",
    "@adobe/react-native-aepedge": "^2.0.0",
    "@adobe/react-native-aepedgeidentity": "^2.0.0",
    "@adobe/react-native-aepedgeconsent": "^2.0.0",
}

iOS:

import AEPCore
import AEPSignal
import AEPServices
import AEPLifecycle
import AEPIdentity
import AEPAssurance
import AEPAnalytics
import AEPUserProfile


 MobileCore.setLogLevel(.debug)
     let adobeAppID = Bundle.main.object(forInfoDictionaryKey: "Adobe_D") as! String
     let appState = application.applicationState
     MobileCore.registerExtensions([ Assurance.self,
                                     Analytics.self,
                                     UserProfile.self,
                                     Signal.self,
                                     Lifecycle.self,
                                     Identity.self,
                                   ], {
       MobileCore.configureWith(appId: adobeAppID)
       if appState != .background { MobileCore.lifecycleStart(additionalContextData:
       ["contextDataKey": "contextDataVal"]) }
         })

Android:

import com.adobe.marketing.mobile.AdobeCallback;
import com.adobe.marketing.mobile.Analytics;
import com.adobe.marketing.mobile.Assurance;
import com.adobe.marketing.mobile.Identity;
import com.adobe.marketing.mobile.InvalidInitException;
import com.adobe.marketing.mobile.Lifecycle;
import com.adobe.marketing.mobile.LoggingMode;
import com.adobe.marketing.mobile.MobileCore;
import com.adobe.marketing.mobile.Signal;
import com.adobe.marketing.mobile.UserProfile;

 MobileCore.setApplication(this);
         MobileCore.setLogLevel(LoggingMode.DEBUG);
         try {
             Assurance.registerExtension();
             Analytics.registerExtension();
             UserProfile.registerExtension();
             Identity.registerExtension();
             Lifecycle.registerExtension();
             Signal.registerExtension();

             MobileCore.configureWithAppID(getString('adobe_ID'));
             MobileCore.start(new AdobeCallback() {
                 @Override
                 public void call(Object o) {
                     MobileCore.lifecycleStart(null);
                 }
             });
         } catch (InvalidInitException e) {

         }

Expected Behaviour

getExperienceCloudId API should return value.

import {Identity} from '@adobe/react-native-aepedgeidentity';

  Identity.getExperienceCloudId()
    .then(cloudId => console.log('experience Cloud id: ' + cloudId))
    .catch(error => console.log('experience cloud id Error: ' + error));
};

Ex: Expected value
52612667349873636375709475823783369529

Actual Behaviour

getExperienceCloudId API should return value.

import {Identity} from '@adobe/react-native-aepedgeidentity';

  Identity.getExperienceCloudId()
    .then(cloudId => console.log('experience Cloud id: ' + cloudId))
    .catch(error => console.log('experience cloud id Error: ' + error));
};

Error:
getExperienceCloudId call timed out

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Call Identity.getExperienceCloudId() function on react native App.

Platform and Version

iOS
Android

Sample Code that illustrates the problem

import {Identity} from '@adobe/react-native-aepedgeidentity';

 Identity.getExperienceCloudId()
    .then(cloudId => console.log('experience Cloud id: ' + cloudId))
    .catch(error => console.log('experience cloud id Error: ' + error));
};

Looking forward to hear form you ASAP.
Thanks.

updateIdentities not available in react

Hello,

is there any plan or even ETA to expose all methods of com.adobe.marketing.mobile.edge.identity.Identity to be used in react native?

Namely

updateIdentities
removeIdentity
getIdentities

Thank you!

RCTAEPCore is undefined

Expected Behaviour

Both Android and IOS device run without error

Actual Behaviour

IOS device runs with error saying that RCTAEPCore is undefined.

Reproduce Scenario (including but not limited to)

Run React Native in IOS device

Steps to Reproduce

react-native: 0.72.6
@adobe/react-native-aepcore: ^5.0.0
Yarn/pnpm

Followed all the steps for IOS and Android documented on the readme.

Platform and Version

Mac M2

Sample Code that illustrates the problem

MobileCore.collectPii({ myPii: 'data' });

Logs taken while reproducing problem

 TypeError: Cannot read property 'collectPii' of null
This error is located at:
    in App
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer

I wonder if there is any configuration for IOS missing on the readme. Thank you very much for your help!

CircleCI Xcode Deprecations

As of Aug 2, CircleCI will be deprecating a set of Xcode versions, including Xcode 12.0.1 which is used by the pipeline in this project. The Xcode version will need to be updated, but in newer versions of the Xcode image, CircleCI hard codes the xcode path where react native is not expecting it, so the ios build fails. We will need to find a workaround for this issue.

Relevant Posts:
https://support.circleci.com/hc/en-us/articles/360052260151-Resolving-Path-Applications-Xcode-X-X-app-doesn-t-exist-errors
https://discuss.circleci.com/t/circleci-fails-to-open-xcode/40777
https://circleci.com/docs/testing-ios#images-using-xcode-13-and-later

"react-native run-ios" failed on CI

After updating the CI environment to use Xcode 14.1, the react-native run-ios command failed with the below error message on CI. But the command works correctly on my M1 Mac book Pro.

Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'AEPSampleApp' from project 'AEPSampleApp')
    Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'AEPSampleApp' from project 'AEPSampleApp')
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening AEPSampleApp.xcworkspace.
error Command failed with exit code 1.

Compile Issue with npm run tsc

Prerequisites

  • This is not a Security Disclosure, otherwise please follow the guidelines in Security Policy.
  • I have searched in this repository's issues to see if it has already been reported.
  • I have updated to the latest released version of the SDK and the issue still persists.

Bug summary

Typescript compile issue on files -
@adobe/react-native-aepedge/ts/Edge.ts
@adobe/react-native-aepedge/ts/models/ExperienceEvent.ts

Environment

OS: macOS 14.4.1
CPU: (8) x64 Apple M1 Pro
Memory: 34.47 MB / 32.00 GB

Steps to reproduce

  1. npm install @adobe/react-native-aepedge
  2. npm run tsc

Current behavior

node_modules/@adobe/react-native-apedge/ts/Edge.ts(70,3): error TS2322: Type ' (hint?: string l undefined) => void' is not
assignable to type'(hint?:string | null | undefined) → void'.
Types of parameters 'hint' and 'hint' are incompatible.
Type 'string I null | undefined' is not assignable to type 'string I undefined'. node_modules/@adobe/react-native-apedge/ts/models/ExperienceEvent.ts(54,7): error TS2322: Type
«string, any> I unc
'Record«string, any> | null | undefined' is not assignable to type 'Record«string, any> | undefi ned'•
Type 'null' is not assignable to type 'Record«string, any> | undefined'.
node_modules/@adobe/react-native-apedge/ts/models/ExperienceEvent.ts (55,7): error TS2322: Type
'string
I null I undefined' is not assignable to type 'string I undefined".
Type 'null' is not assignable to type
'string I undefined'.
node_modules/@adobe/react-native-apedge/ts/models/ExperienceEvent.ts (56,7): error TS2322: Type
'string I null | undefined' is not
assignable to type 'string I undefined'.
anne vender 56.2 error T52372: Te
node_ modules/@adobe/react-native-apedge/ts/models/ExperienceEvent. ts (57,7): error TS2322: Type
"Record«string, any> | null | undefined' is not assignable to type Record«string, any> | undefi ned'.
node_modules/@adobe/react-native-apedge/ts/models/ExperienceEvent. ts(60,7): error TS2322: Type
'Record«string, any> | null | undefined' is not assignable to type 'Record<string, any> | undefi ned'.
node_modules/@adobe/react-native-apedge/ts/models/ExperienceEvent. ts (61,7): error TS2322: Type
'string I null | undefined' is not
assignable to type
'string I undefined'.
npm ERR! Lifecycle script 'compile' failed with error: npm ERR! Error: command

Expected behavior

No response

Anything else?

No response

ACP to AEP ReactNative Migration failling

Expected Behaviour

I've been trying to migrate ACP-Prefix to AEP-Prefix using the migration guide https://github.com/adobe/aepsdk-react-native/blob/main/docs/migration.md . The expected behavior after making the migration is TrackState and TrackAction sending data to Adobe and data reaching to Adobe.

Actual Behaviour

Data isn't being sent and isn't reaching to Adobe when using trackState and trackAction.

Reproduce Scenario (including but not limited to)

Steps to Reproduce

REACT NATIVE DEPENDENCIES

"@adobe/react-native-aepcore": "^5.0.1"

APPDELEGATE REGISTRATION

@import AEPCore;
@import AEPServices;
@import AEPLifecycle;
@import AEPIdentity;
@import AEPSignal;

[AEPMobileCore configureWithAppId:ADB_APP_ENVIRONMENT_ID];
[AEPMobileCore setLogLevel: AEPLogLevelTrace];

//[ACPCore setWrapperType:ACPMobileWrapperTypeReactNative];
const UIApplicationState appState = application.applicationState;

[AEPMobileCore registerExtensions: @[
        AEPMobileIdentity.class,
        AEPMobileLifecycle.class,
        AEPMobileSignal.class,
    ] completion:^{
      if (appState != UIApplicationStateBackground) {
       [AEPMobileCore lifecycleStart:nil];
      }
    }];

TRACK STATE AND TRACK ACTION USAGE

import {MobileCore} from '@adobe/react-native-aepcore';

let contextData: { [key: string]: string } = {
"event.name": "Page Loaded Test1",
"page.name": "login",
}
useEffect(() => {
MobileCore.trackState('login', contextData);
}, []);

LAUNCH PROPERTY EXTENSIONS
Adobe Analytics v2.3.4
Mobile Core v2.2.3
Profile v2.1.2
Identity v1.1.2

Platform and Version

"react-native": "0.71.6",

More Details

There are two ways to implement Adobe Analytics for Mobile (https://developer.adobe.com/client-sdks/home/getting-started/#integration-via-solutions-specific-endpoints)

  1. Specific endpoints
  2. AEP and datastreams.

Is there a way to implement Adobe Analytics in ReactNative using Point Product Implementation? or unfortunately this is just available for native iOS and Android ?

Error: Use of '@import' when C++ modules are disabled, consider using -fmodules and -fcxx-modules

While attempting to add the AEPCore SDK to my iOS app, I encountered an issue preventing the code from compiling.

Use of '@import' when C++ modules are disabled, consider using -fmodules and -fcxx-modules

Expected Behaviour

After adding AEPCore SDk and running pod install, the app should build and run successfully on iOS

Actual Behaviour

During build phase, the following error causes the build to fail: Use of '@import' when C++ modules are disabled, consider using -fmodules and -fcxx-modules

Reproduce Scenario (including but not limited to)

Create a new React Native app using Expo: npx create-expo-app my-app

Install AEPCore SDK via npm: npm install @adobe/react-native-aepcore

"Prebuild" to expose iOS folder: expo prebuild --platform ios

Ensure pods installed via: cd ios && pod install

Add imports to AppDelegate.h and implementation to AppDelegate didFinishLaunchingWithOptions per README

Build and run the project via expo run:ios or via XCode

Build fails

Platform and Version

Issue occurs only for iOS. Android integration works as expected

"@adobe/react-native-aepcore": "^1.0.0",
"expo": "~47.0.12",
"react": "18.1.0",
"react-native": "0.70.5",

Sample Code that illustrates the problem

Sample attached:
adobe-sample-expo-react-native.zip

Use of undeclared identifier 'AEPMobileCore'

Prerequisites

  • This is not a Security Disclosure, otherwise please follow the guidelines in Security Policy.
  • I have searched in this repository's issues to see if it has already been reported.
  • I have updated to the latest released version of the SDK and the issue still persists.

Bug summary

Hi guys, I'm trying to implement the latest version of AEP SDK .
I already followed the guidelines and I got this error

Use of undeclared identifier AEPMobileCore

I cannot use any classes from AEP SDK even though I already imported according to the guidelines
image

Environment

Node: 20.12.0
NPM: 10.5.0
Xcode: 15.3
React Native: 0.70.14
React Native AEP SDK: 6.0.0

[Request] Add support for NativeScript - aepsdk-nativescript

I'm not sure where this request fit best, but since NativeScript is similar to React Native (cross platform app development framework) I thought this could be a nice place to ask.

Would it be possible for you to provide an official SDK for NativeScript? I don't mean to add support for it in this repository, but the create a new repo for this purpose. There is an existing one here, but it's now a bit dated, and I don't think they (Essent) are so active in the mobile app world anymore.

More info on NativeScript: https://nativescript.org/
Plugin seed for NativeScript plugins: https://github.com/NativeScript/plugin-seed

Update Assurance Android Manifest to work with Android 12

Android 12 requires to include Android:exported attribute for Android Manifest Activity.
We need to update this attribute for Assurance package AndroidManifest.xml.

Expected Behaviour

Actual Behaviour

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Platform and Version

Sample Code that illustrates the problem

Logs taken while reproducing problem

Add EdgeBridge Wrapper

Add React Native EdgeBridge Wrapper.

  • add ts, iOS, android implementation
  • update and test sample app
  • update unit test
  • update documentation

[Edge] Add Support for Datastream Config Override Feature

Task description

  • Update Experience Event class to support the config override feature
  • Add datastreamIdOverride (string)
  • Add datastreamConfigOverride (Map<String, Object>)
  • Add usage documentation

Additional implementation details or code snippet(s)

No response

Hard-coded Android SDK versions in build.gradle cause build failure with Android 0.70.6

Expected Behaviour

Adding these packages to my project results in a successful build.

Actual Behaviour

The Android build.gradle files for each package here have hard-coded values for the compileSdkVersion, minSdkVersion, and targetSdkVersion. This causes build errors with React Native 0.70.6:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':adobe_react-native-aepuserprofile:processDebugAndroidTestManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library [com.facebook.react:react-native:0.70.6] /Users/kdice/.gradle/caches/transforms-3/4b3c55c96a7b7307f23241c80fa0f0d7/transformed/jetified-react-native-0.70.6-debug/AndroidManifest.xml as the library might be using APIs not available in 16
        Suggestion: use a compatible library with a minSdk of at most 16,
                or increase this project's minSdk version to at least 21,
                or use tools:overrideLibrary="com.facebook.react" to force usage (may lead to runtime failures)

Reproduce Scenario (including but not limited to)

React Native 0.70.6 (and likely other versions).
The latest published versions of any packages from this repo.

Steps to Reproduce

Follow the readme instructions, attempt a build.

React Native iOS - Underlying Objective-C module 'AEPRulesEngine' not found

The latest version "@adobe/react-native-aepcore": "2.0.0" experiencing this issue in iOS only and it was working 1.0.0

Expected Behaviour

Actual Behaviour

Reproduce Scenario (including but not limited to)

Steps to Reproduce

  1. yarn add @adobe/react-native-aepcore
  2. cd iOS && pod install
  3. Import these on your iOS AppDelegate
    import AEPCore
    import AEPSignal
    import AEPServices
    import AEPLifecycle
  4. Go to product from the menu --> Archive

Platform and Version

React Native - iOS

Sample Code that illustrates the problem

Logs taken while reproducing problem

AEPCoreEngine

Screenshot 2023-04-05 at 11 04 14

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.