-
Notifications
You must be signed in to change notification settings - Fork 199
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
Purchase Connector React Native #582
base: development
Are you sure you want to change the base?
Conversation
Update docs related to expo-android and deep linking
UDL - added a note at the beginning of the file
User invite: added note per kb request
New support comment
…1-rc1 Releases/6.x.x/6.15.x/6.15.1 rc1
ios/PCAppsFlyer.m
Outdated
|
||
// Perform a check to ensure that we do not reconfigure an existing connector. | ||
if (connector != nil) { | ||
reject(@"401", @"Connector already configured", nil); |
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.
Why do we use status codes?
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.
Removed status code and used the error messages
export type PurchaseConnectorListener = (data: any) => void; | ||
|
||
// Type definition for a listener which gets called when the `PurchaseConnectorImpl` receives purchase revenue validation info for iOS. | ||
export type DidReceivePurchaseRevenueValidationInfo = (validationInfo?: Map<string, any>, error?: IosError) => void; |
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 react native we usually use 'on' for prefix in callback names (onSuccess, onClick, onSubmit..).
'did' is usually for obj-c projects.
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.
Changed to onReceivePurchaseRevenueValidationInfo!
index.js
Outdated
function setInAppValidationResultListener(onResponse, onFailure) { | ||
const inAppValidationListener = purchaseConnectorEventEmitter.addListener( | ||
AppsFlyerConstants.IN_APP_VALIDATION_RESULT_LISTENER, | ||
(result) => { | ||
try { | ||
const validationResult = JSON.parse(result); | ||
onResponse(validationResult); | ||
} catch (error) { | ||
onFailure("Failed to parse in-app purchase validation result", error); | ||
} | ||
} | ||
); |
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 need to be consistent with how we write our code and how we want the plugin to behave. The onGCD callback we have 2 "setters": 1 for success and 1 for failure. So here we should do the same Link
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.
Separated to 2 setters and followed the old convention as you mentioned in the link
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.
For subscription and for in apps
No description provided.