-
Notifications
You must be signed in to change notification settings - Fork 38
Core - renaming public APIs #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* commit 'b58470acfaf35b5dc6abdabc413233d609de9a51': EdgeIdentity (1.0.0-alpha.2) -> main (adobe#62) # Conflicts: # apps/AEPSampleApp/ios/Podfile.lock
…inning October 4, 2021 (adobe#73)
…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> { |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/adobe/aepsdk-core-ios/blob/daa7245798d99b9cc85f827a125d069aa7a54c29/AEPCore/Sources/core/MobileCore.swift#L118
1 second is the default timeout value of AEPCore API. We didn't overwrite it anyway.
| * @see PrivacyStatus | ||
| */ | ||
| syncIdentifiersWithAuthState(identifiers?: {string: string}, authenticationState: string) { | ||
| syncIdentifiersWithAuthState(identifiers?: { string: string }, authenticationState: string) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
packages/core/js/models/LogLevel.js
Outdated
| const ERROR = "AEP_LOG_LEVEL_ERROR"; | ||
| const WARNING = "AEP_LOG_LEVEL_WARNING"; | ||
| const DEBUG = "AEP_LOG_LEVEL_DEBUG"; | ||
| const VERBOSE = "AEP_LOG_LEVEL_VERBOSE"; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
emdobrin
left a comment
There was a problem hiding this 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
| const LOGGED_OUT = "AEP_VISITOR_AUTH_STATE_LOGGED_OUT"; | ||
| const UNKNOWN = "AEP_VISITOR_AUTH_STATE_UNKNOWN"; |
There was a problem hiding this comment.
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" | ||
| /> |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: