-
Notifications
You must be signed in to change notification settings - Fork 1
Upgrade react native 0.79.4 + Removed Mixpanel from Native Android/IOS SDKs #106
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
base: upgrade/react-native-0.79.4
Are you sure you want to change the base?
Upgrade react native 0.79.4 + Removed Mixpanel from Native Android/IOS SDKs #106
Conversation
…w tracking - Replaced Mixpanel tracking calls in SCLoans with internal analytics events - Removed Mixpanel SDK dependency from gradle - Verified build and functionality on working version
React-Native Bridge for Android successfully propagating events from Native Android SDK(Producer) to Smart Investing Appln (Consumer): React-Native Bridge for IOS successfully propagating events from Native Android IOS(Producer) to Smart Investing Appln (Consumer): |
…intainability - Simplified event flow between native and JS layers - Improved code readability and reduced complexity - Easier to extend with new analytics events in future
…ved maintainability - Simplified event flow between native and JS layers - Improved code readability and reduced complexity - Easier to extend with new analytics events in future
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.
install the "prettier" vscode extention for formatting js files. make sure that it matches the older style
(here the diff should only show changes that you've already made)
return SmallcaseGatewayNative.archiveSmallcase(safeIscid); | ||
}; | ||
|
||
/** | ||
* Returns the native android/ios and react-native sdk version | ||
* (internal-tracking) | ||
* @returns {Promise} |
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 did we remove these return and param types?
|
||
/** | ||
* 🔕 Unsubscribe from Gateway Event | ||
* @param {object} subscription - Subscription returned from startGatewayEventListening |
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 param and return types can be better. make it closer to the actual types, instead of generic types
this.isInitialized = true; | ||
console.log('[SCLoansEvents] Initialized for', Platform.OS); | ||
} else { | ||
console.warn('[SCLoansEvents] Native module not found for', Platform.OS); |
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 probably should be thrown as an error. shouldn't silently fail
} | ||
|
||
try { | ||
const subscription = this.eventEmitter.addListener('scloans_notification', (eventData) => { |
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.
keep all these strings ("scloans_notification") as constants. don't use them directly
type: eventData.eventType || eventData.type || 'unknown_event', | ||
eventType: eventData.eventType || eventData.type || 'unknown_event', | ||
data: eventData.data || eventData, | ||
timestamp: eventData.timestamp || Date.now(), |
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.
do these fallbacks make sense?
please check with the analytics team on what should be the correct fallback values such that invalid values don't make it into real analysis
|
||
this.subscriptions.push(subscription); | ||
|
||
console.log('SCLoansEvents Subscribed to gateway events'); |
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.
remove all these console logs from the SDK
const index = this.subscriptions.indexOf(subscription); | ||
if (index > -1) { | ||
this.subscriptions.splice(index, 1); | ||
} |
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.
better to use array.filter()
USER_IDENTIFY: 'scgateway_user_identify', | ||
}; | ||
|
||
export class SCGatewayEvents { |
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.
here again, a lot of the event emitter code is duplicated.
structure it in a way where things can be shared as much as possible
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.
Actually we are treating both the sdks as separate and isolated. So, created separate files to support this. Same is true in android implementation as well for Notification Center.
No description provided.