Direct Message to more than one person : twitter MGTwitterEngine - ios4

I want to send direct message to more than one person with a single call
I am using MGTwitterEngine
and calling function like this
[requestDict setObject:#"direct_message" forKey:[twitterObj sendDirectMessage:#"this is test from iphone app" to:#"user_id"]];
this is sending ok
but am not able to send it to multiple people , how can I do this
I tried it with comma separated user_ids but not works
Thanks
Amit Battan

Regardless of whether MGTwitterEngine supports a call that looks like it allows you to send a direct message (DM) to more than one user, the Twitter API doesn't support a call like that.
The API method behind the scenes (direct_messages/new) only allows the authenticating user to send a DM to one user only. So, if the single call is working for you, just iterate over your list of Twitter users and send them the DM with the call you specified.
Also, you don't have to worry about rate limiting when sending a DM.

Related

How to send different message to multiple users by hitting single api of FCM?

I have a use case where I want to send a notification using FCM to multiple users(say 1000) every minute.
Below are some conditions that I also need to take care of
Every minute users will be different based on some conditions. So i can't create a group or topic using fcm.
Every user will receive a different message.
I don't want to hit fcm's request 1000 times every single minute.
Please help here
You can send a batch of (up to 500) messages, where each message has its own payload and audience (such a topic of tokens). So for 1000 unique tokens, you'd in that case only hit the API endpoint twice.
The Admin SDK (which is available for Node.js) implement a simple method call for this, but I also recommend having a look at the REST API example on the page I linked, as I found it interesting to see how this is implemented behind the scenes.

Best way to efficiently send 1000 unique emails using the sendgrid/mail library for Node.JS

I have an admin panel in my Node.JS application where admins can login and send emails to groups of users. Sometimes these groups can contain up to 1,000 people. When the admin composes an email in the admin panel and hits the send button, I grab each row from the database and generate a unique link for that email body and then send it using the #sendgrid/mail npm package. I have looked at the following page and it is helpful: https://github.com/sendgrid/sendgrid-nodejs/blob/master/use-cases/README.md#email-use-cases
However, I don't know if it's more efficient to create a giant array of emails and dump that into one of the libraries methods, or if I should loop through and make a separate method call in each iteration and use Promise.all. I suppose I need a solution that won't make the Sendgrid rate limits angry but also not keep my http request loading for 30 seconds for the admin.
Thank you
From the UI you should get all the users that are to be emailed, into the node.js backend app.
In the backend app, assuming you get an array of the users, you use the Arrays.map() method to execute a function returns a promise that will send out the email.
You can then use Promise.all() to see what emails got send and what failed.
If there are any failures you can show that as a notification to the Admins on the UI, for only those users that failed.
Also note the SendGrid API seems to be capable of accepting 10k requests per second. Do take a look at this.

I need a method to send a direct message to some user using excel

I need to find a method to use excel to send a direct message to slack user like we use MAilto in with subject and body function to send the user email,
for example (WhatsaApp)
api.whatsapp.com/send?phone=XXYYYYYYYYYY&text=This is my message
Well if i understand correctly, you want to get info from excel and send this info to a user, well that's possible in one way, you have to be able to read excel, which i don't recommend.
i recommend Google spreadsheet for that. anyway lets not get off-topic.
then you need to know how to send message to slack, Do you know ?
i will assume not, so to send messages there is two ways,
Webhooks
Web API
method URL = https://slack.com/api/chat.postMessage
to Send Through Web API, you have to pass the following arguments:
token The Oauth2 Token you will get from slack when configuring your bot or app, Or you can use Legacy tokens instead
channel The place you want to send the message, Channel ID if it is a channel, or User ID if it is a User.
text As the name say, the message you want to send
as_user Whether you want to send the message as your name or as a Custom name, This a boolean method, Means its Only True or False
Note: To configure a custom name its in another argument we will reach.
attachments A JSON-based array of structured attachments, presented as a URL-encoded string.
username The name you want to appear as the sender of the message, only works if as_user is false, if as_user is true, it will ignore this argument.
Hope this help.
and please next time share a code so we can help, here there is not just 'I need...'
its a place where you share code and then ask 'I need...' so we can help
I have solved the issue already
Creating an APP and using the chat.postmessage

How to trigger an application in mobile automatically

My idea is to make an application start automatically when a message from a specific user reaches the inbox of the mobile . For example if my friend sends some numbers to my mobile, the sms has to be read and validated first and then calculator ( inbuilt mobile application) has to be triggered and process the numbers from the message. Please help me with the above query.
I am far from convinced you will be able to give the phone user access to the same sms you use to launch your MIDlet.
You may need to use native development on the phones that support it if J2ME can't give you exactly what you need.
In any case, you probably want to try with J2ME first so you need to read the specifications for JSR-118 and its PushRegistry API, along with JSR-120, which interfaces with SMS.
Most current J2ME-enabled phones will support static SMS Push but you will need to send the SMS to a particular port, much like you would data over a standard library socket.
I don't think you can trigger on just any old SMS message arriving.
This is the class you want to look at, in any case:
javax.microedition.io.PushRegistry

How to Send Group Sms?

Can we send SMS programatically by selecting group from the address book using J2me?
yes... it is possible to have access to the users phonebook (if supported on the device(most modern devices do allow it)) via PIM(JSR 75).
And sending SMS's from j2me is also possible(again if the user allows this).
It turns out you can only send a single message to a single recipient at a time using JSR-205.
If you want to send the same message to many recipients, you have to loop around
javax.wireless.messaging.Message.setAddress();
javax.wireless.messaging.MessageConnection.send();
There is no way to add a javax.microedition.pim.ContactList to a Message or to a MessageConnection because there can't be any API dependancy between JSR-205 and JSR-75.
The latest JavaME SDK contains example code that shows how to read contact data in a MIDlet.

Resources