Android – Facebook SDK AppEventsLogger logEvent doesn't work

3.6k views Asked by At

Googling didn't help me. I'm trying to push data on Facebook dashboard via Facebook app events My code is:

    AppEventsLogger logger = AppEventsLogger.newLogger(this);
    logger.activateApp(this, Utility.FACEBOOK_ID);
    logger.logEvent(AppEventsConstants.EVENT_NAME_COMPLETED_TUTORIAL);

So, activateApp works fine, but logEvent doesn't. I've checked app ID and recreated it, but I have the same problem.

2

There are 2 answers

0
Nazar Ivanchuk On

Hi you can try add the next row after 'logEvent' method.

logger.flush();

I hope it will be helpful for you.

0
Yachao On

you need to make sure you have initialized the FB successfully before you calling the logger events:

Facebook.sdkInitilize(Context context);