3

I am trying to integrate Facebook Messenger platform in my Android app.

FacebookSdk.sdkInitialize(getApplicationContext());
String mimeType = "image/jpeg";
String metadata = "{ \"type\": \"event\" }";
ShareToMessengerParams shareToMessengerParams = ShareToMessengerParams
    .newBuilder(Uri.fromFile(new File("/sdcard/Images/img.jpg")), mimeType)
    .setMetaData(metadata)
    .build();
MessengerUtils.shareToMessenger(this, 1, shareToMessengerParams);

Content from AndroidManifest.xml

<intent-filter>
    <action android:name="android.intent.action.PICK"/>
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="com.facebook.orca.category.PLATFORM_THREAD_20150314" />
</intent-filter>

Then I am using below code to get metadata back from Intent

MessengerThreadParams mThreadParams = MessengerUtils.getMessengerThreadParamsForIntent(intent);
String metadata = mThreadParams.metadata;

But still I am not getting metadata back, I followed it exactly the way its mentioned in Messenger Documentation.

Sumit Chourasia
  • 2,394
  • 7
  • 30
  • 57
  • Can you access the participants? Additionally, are you able to access the metadata directly from the Intent?(https://developers.facebook.com/docs/messenger/android#intent_metadata_user_ids) – Rafael Munoz Jul 21 '15 at 15:27
  • I am also facing the same issue. Followed the exact sequence of steps given. In my case I do get the participants info but not the metadata. Tried directly from parsing the intent as well. Also, this happens for some cases not all. Sometimes, I get back the metadata properly as expected. Did not notice the issue in KitKat, only in Lolipop. Not sure if its relevant. – kinshukkar Jul 24 '15 at 12:37
  • Found this duplicate stack overflow question which seems to fix this - http://stackoverflow.com/questions/30769174/facebook-messenger-sending-metadata-android – kinshukkar Jul 24 '15 at 12:56
  • its working for you? – Sumit Chourasia Jul 24 '15 at 13:10

0 Answers0