4

i need to know if there is a possibility to know what kind of device are u useing for the facebook mess , im using the microsoftchatbot , and i need to know if the user is using a pc/laptop or a mobile device

i have tryed looking at the session data and i cannot see the device

{ type: 'conversationUpdate',
  timestamp: '2017-10-11T09:12:54.8111475Z',
  membersAdded: [ { id: 'EmpHard@qQ09zeUT83I', name: 'EMPP' } ],
  text: '',
  attachments: [],
  entities: [],
  address: 
   { id: 'DC7cCyV4Pn4',
     channelId: 'webchat',
     user: { id: 'edb347769a4ba0863dd0e8b44d93358d' },
     conversation: { id: 'edb347760e8ba0863ddb49a44d93358d' },
     bot: { id: 'EmpHard@qQ09zeUT83I', name: 'EMPP' },
     serviceUrl: 'https://webchat.botframework.com/' },
  source: 'webchat',
  agent: 'botbuilder',
  user: { id: 'db34776e0e8b49a4ba0863dd4d93358d' } }
nacho
  • 5,280
  • 2
  • 25
  • 34
  • Welcome to Stackoverflow, please have a look at the link on [how to ask questions on Stackoverflow](http://stackoverflow.com/help/how-to-ask). Consider reformulating your question else it will be downvoted or deleted. – Pierre Chevallier Oct 11 '17 at 09:44

1 Answers1

2

The device information is not included in the message data. Facebook messenger doesn't differentiate between mobile devices and desktops.

Xeno-D
  • 2,175
  • 11
  • 15
  • 2
    This question became even more important now because Facebook is introducing some breaking changes only applicable to the web (https://developers.facebook.com/docs/messenger-platform/europe-updates#changelog, https://developers.facebook.com/community/threads/812696716178958/). Is there still no way to differentiate between mobile and web users? – Thusitha Dec 03 '20 at 00:21
  • Looking for the same advice. Let me know if someone has any links / references – Deepak Mahakale Dec 03 '20 at 10:24
  • I am okay with starting a bounty for this question as well – Deepak Mahakale Dec 03 '20 at 10:24
  • As far as I'm aware there is still no way to do this, though its been a while since I had to work on a FB bot. There seems to be some advice from FB [here](https://developers.facebook.com/docs/messenger-platform/europe-updates#other) that basically says to split the template into multiple images and text messages. It seems like FB sends a [default message](https://developers.facebook.com/docs/messenger-platform/europe-updates#fallback-webhook) to the user if the template is not accepted so you might be able to check the conversation history for this message and act if you see this message. – Xeno-D Dec 03 '20 at 12:34