Skip to content

Conversation

@yangyansong-adbe
Copy link
Contributor

Description

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

* add a new API in Core -? resetIdentities

* update core package version to alpha.2
* commit 'b58470acfaf35b5dc6abdabc413233d609de9a51':
  EdgeIdentity (1.0.0-alpha.2) -> main (adobe#62)

# Conflicts:
#	apps/AEPSampleApp/ios/Podfile.lock
* staging:
  fix the release issue: NPM registry enforces a minimum of TLS 1.2 beginning October 4, 2021 (adobe#73)
  add a FAQ section (adobe#66)
  Update README.md
  add a new API in Core - resetIdentities (adobe#63) (adobe#64)
  EdgeIdentity (1.0.0-alpha.2) -> main (adobe#62)
* commit 'ca66509d5cf215d594be6b9eeb894cb3c3d913cd':
  Merge latest staging changes (adobe#85)
  add a new API in Core - resetIdentities (adobe#63)

# Conflicts:
#	apps/AEPSampleApp/ios/Podfile.lock
#	yarn.lock
…aming

* commit '801cf01b932470064b8f358784b589f4b3c5bbd4':
  Reduce visibility for utility classes and handle error callback (adobe#86)

# Conflicts:
#	packages/core/android/src/main/java/com/adobe/marketing/mobile/reactnative/RCTAEPCoreDataBridge.java
#	yarn.lock
* @return true if the the event dispatching operation succeeded, otherwise the promise will return an error
*/
dispatchEvent(event: AEPExtensionEvent): Promise<boolean> {
dispatchEvent(event: Event): Promise<boolean> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This API can be renamed to dispatch(event: Event)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think dispatchEvent is a better option for the loosely typed JavaScript. We also use this method name in Android SDK ->

public static boolean dispatchEvent(final Event event, final ExtensionErrorCallback<ExtensionError> errorCallback)

* @see AEPCore#dispatchResponseEvent(Event, Event, ExtensionErrorCallback)
*/
dispatchEventWithResponseCallback(event: AEPExtensionEvent): Promise<AEPExtensionEvent> {
dispatchEventWithResponseCallback(event: Event): Promise<Event> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be renamed to: dispatchWithResponseCallback..

Unrelated to your changes, but I noticed this API overwrites the timeout to 1 sec in the objc implementation. Is this the desired behavior or can we fallback to the default in the native extension?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* @see PrivacyStatus
*/
syncIdentifiersWithAuthState(identifiers?: {string: string}, authenticationState: string) {
syncIdentifiersWithAuthState(identifiers?: { string: string }, authenticationState: string) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why authenticationState is not of type MobileVisitorAuthenticationState ? Same for the APIs below

Copy link
Contributor Author

@yangyansong-adbe yangyansong-adbe Nov 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/adobe/react-native-acpcore/blob/05a9b2ed10ccec9e7ae1693913884eaa03c6e060/js/ACPIdentity.js#L67
I just followed what we did in ACPIdentity wrapper. I'm not familiar with Identity extension, please feel free to caret a new PR to fix this issue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion we can use the enum here for the AEP wrapper. Would you revisit this in the final review of the Core extensions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Emm ... I think we'd better let our Identity experts fix this issue in another PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, let's revisit this in a separate PR, I created #96

const ERROR = "AEP_LOG_LEVEL_ERROR";
const WARNING = "AEP_LOG_LEVEL_WARNING";
const DEBUG = "AEP_LOG_LEVEL_DEBUG";
const VERBOSE = "AEP_LOG_LEVEL_VERBOSE";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we rename all the constants too? e.g. AEP_LOG_LEVEL_VERBOSE -> VERBOSE
This comment applies for all enums

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'd better keep those AEP information, then it should be easier to identify wrapper logs in react native console.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the usage looks like LogLevel.VERBOSE or PrivacyStatus.AUTHENTICATED I feel the string constant will be more consistent with the usage that way if we don't have any other limitations.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree an Enum should be a better fit here. I don't know if there is any limitation to it. Can you create a GitHub issue for it? I need to figure out why we use String instead of Enum here, then we can decide what we can do later.

Copy link
Contributor

@emdobrin emdobrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks with with some small comments

Comment on lines 19 to 20
const LOGGED_OUT = "AEP_VISITOR_AUTH_STATE_LOGGED_OUT";
const UNKNOWN = "AEP_VISITOR_AUTH_STATE_UNKNOWN";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These ones need updates too

<Button
onPress={() => navigation.navigate('Identity')}
title="Identity"
/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L17 requires update to navigate('CoreView')


function syncIdentifiersWithAuthState() {
AEPIdentity.syncIdentifiersWithAuthState({"id1": "identifier1"}, "AEP_VISITOR_AUTH_STATE_AUTHENTICATED");
Identity.syncIdentifiersWithAuthState({ "id1": "identifier1" }, "AEP_VISITOR_AUTH_STATE_AUTHENTICATED");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can use MobileVisitorAuthenticationState.AUTHENTICATED

* @see PrivacyStatus
*/
syncIdentifiersWithAuthState(identifiers?: {string: string}, authenticationState: string) {
syncIdentifiersWithAuthState(identifiers?: { string: string }, authenticationState: string) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, let's revisit this in a separate PR, I created #96

@yangyansong-adbe yangyansong-adbe merged commit 638519e into adobe:core Nov 29, 2021
@yangyansong-adbe yangyansong-adbe deleted the core-renaming branch December 17, 2021 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants