Having trouble getting socialize:messaging working with React Native


Newbie to Meteor/React Native and have been enjoying the super fast development so far, but seem to have run into my first speed bump. More like I’m stuck in a ditch and could really use some help. :frowning: @spencercarli @copleykj

class Inbox extends Component {
    constructor(props) {
    renderRow(message) {
        return (
    render() {
        return (

export default createContainer(params => {
    return {};
}, Inbox);

Now, I’m assuming I need to make a publication that returns the messages of the conversations that the currently logged in user is participating in?


export default () => {
    Meteor.publish('messages', function () {

       var conversations = Meteor.conversations.find({_participants: this.userId});//better way to get conversations for the current user?
        // now i don't know what to do!!

        conversations.forEach(function(c) {
            c.messages(/*optional params*/).forEach(function(message){
	        console.log(message.user().username, ": ", message.body);
// the above seems to get me the information I need
// but I don't know how to do it through a cursor so I can publish it to the client.
// need an ELI5 example

I appreciate it. Thank you so much for your time.


Have you tried the github wiki? Example publications are given there which should get you going. https://github.com/copleykj/socialize-messaging/wiki/Publications


@copleykj Unbelievable response time from the creator himself!! :heart_eyes:

I didn’t, in fact. From now on I will remember to check wiki pages. Meteor.publishWithRelations seems to be just what I needed, after I’d been pretty much stuck all day on this. I’ll give it a shot.

Thank you so much.


You are very welcome. Let me know if you need any further help.


Copy pasted the first wiki example in and it works perfectly. Going to have to check out the other libraries you mentioned: aldeed:simple-schema, tmeasday:publish-with-relations, meteorhacks:unblock. Didn’t know they existed. :stuck_out_tongue: Thanks again.