-
Notifications
You must be signed in to change notification settings - Fork 298
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
How to unification of the two platforms iOS and Android API #6
Comments
The predefined app event constants has not yet been implemented. It's a good idea for a pull request though.... or hang tight and I'll find a bit of time in near future to implement it. |
I compare the APIs of FB's two platforms(iOS / android). eg. EVENT_NAME_ACTIVATED_APP // android event name : // ios event name : I need to rewrite each of the required names by flutter instead of calling the original api |
I extracted every api I needed and temporarily implemented it. eg facebookAppEvents.logEvent(name:‘ fb_mobile_activate_app’) |
Ya, that's the way to do it. The only difference after adding to the plugin is that you get a corresponding constant to refer to: The way that FirebaseAnalytics for Flutter has solved it is that they're implementing a method for each named event. That might also be a way to go about it. |
I've implemented a sample of "activate app" as mentioned in your issue (see commit: efd52f6) I'll implement further support for more events later... or feel free to follow the example by adding more methods and declarations in the same pattern and make a pull request. |
I'll close this issue as the current answer is to just use the generic Thank you for the input and I will start implementing support for the other event codes and accept good pull requests to help completing the list of support. |
I don't know.
how to pass the value is correct.
Eg. iOS FB API.
func logAddToWishlistEvent(contentData : String, contentId : String, contentType : String, currency : String, price : Double) {
let params : AppEvent.ParametersDictionary = [
.content : contentData,
.contentId : contentId,
.contentType : contentType,
.currency : currency
]
let event = AppEvent(name: .addedToWishlist, parameters: params, valueToSum: price)
AppEventsLogger.log(event)
}
Eg. Android
/**
This function assumes logger is an instance of AppEventsLogger and has been
created using AppEventsLogger.newLogger() call.
*/
public void logAddToWishlistEvent (String contentData, String contentId, String contentType, String currency, double price) {
Bundle params = new Bundle();
params.putString(AppEventsConstants.EVENT_PARAM_CONTENT, contentData);
params.putString(AppEventsConstants.EVENT_PARAM_CONTENT_ID, contentId);
params.putString(AppEventsConstants.EVENT_PARAM_CONTENT_TYPE, contentType);
params.putString(AppEventsConstants.EVENT_PARAM_CURRENCY, currency);
logger.logEvent(AppEventsConstants.EVENT_NAME_ADDED_TO_WISHLIST, price, params);
}
The FB API names of the two platforms are different.
Q. Then how should I pass in flutter_app_event?
The text was updated successfully, but these errors were encountered: