Get MessageView from ThreadVIew

432 views
Skip to first unread message

Артем Меженский

unread,
Mar 16, 2016, 4:47:54 PM3/16/16
to InboxSDK
Hello!

I want to get senser, links, body, attachments from a message.
I get a thread from the list.

I received ThreadView array from selected list.
How get MessageView from ThreadView?

My code:

InboxSDK.load('1.0', 'sdk_...').then(function(sdk) {

sdk.Toolbars.registerToolbarButtonForList({
title: 'Get Message from List',
section: sdk.Toolbars.SectionNames.INBOX_STATE,
iconUrl: 'http://...',
onClick: function(selectedThreadRowViews) {

selectedThreadRowViews.selectedThreadRowViews.forEach(function(ThreadView) {
console.log(ThreadView.getSubject());
// which is a method that receives a MessageView
/*ThreadView.registerThreadRowViewHandler(function(MessageView) {
console.log(messageView.getSender());
console.log(messageView.getLinksInBody());
console.log(messageView.getBodyElement().innerHTML);
console.log(messageView.getFileAttachmentCardViews());
});*/
});

}
});

});


Omar Ismail

unread,
Mar 16, 2016, 5:13:43 PM3/16/16
to Артем Меженский, InboxSDK
Hi there, right now you can't get the message details from the threadView in the list - this is because that information isn't available.

That information only becomes available to the SDK when the user navigates to the thread directly.

If you don't want the user to have to navigate to the thread then you'll need to use Gmail's backed API (https://developers.google.com/gmail/api/)


Omar

--
You received this message because you are subscribed to the Google Groups "InboxSDK" group.
To unsubscribe from this group and stop receiving emails from it, send an email to inboxsdk+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/inboxsdk/d52f6923-7726-4d2c-88ab-6ad64752ea29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Артем Меженский

unread,
Mar 16, 2016, 5:43:27 PM3/16/16
to InboxSDK, wood...@gmail.com
Thanks!
Reply all
Reply to author
Forward
0 new messages