I am using parse to handle push notifications. I've added channels based on the city the user is in and the gender of the user. I want to send a push notification to all male users in LA. However, when I create two separate channel conditions in the parse dashboard, the "number of devices that the push will be sent to" is way off. For example:
When I add the condition for the channel "users in la" it says there are 1400 devices.
Then I add a separate condition for the channel "male", and it updates the number of devices to 4000. Note that I am creating two separate channels here, not adding both channels to the same condition, but it still appears to be performing an or instead of an and.
I simply used tags for conditions that I wanted to and -- the webview does not support and'ing between channels.
Related
Is it possible to maintain both group text messages and single text messages with users and keep them separate? I understand there is no concept of a group message per se, but wanted to see if any recent advances in tech has made this possible with Twilio or other providers.
In short, I am creating a POC where a user inside an iOS App can send invoke an API call to my backend application. This application receives a phone number from someone's contact list, and then connects to Twilio to send the SMS message to that target user.
When the user replies, I was researching Twilio Web hooks to receive the message, and then save it in the database. The originating user, then, would be able to see the message on a screen.
I would guess that when a user responds to the twilio message, the only metadata that comes in is their message and phone number, so the "foreign key" is the phone number.. Thus when I save it in my database, I have their phone number and message.
This works up until someone decides to target two or more people in an SMS message using my API, and then target one of those people individually. For example they select me as a sole recipient, and then select me and someone else as a group text message.
In this case, how could my system/Twilio differentiate between if I was responding to the group message, or to the single message?
Any ideas or work arounds? Maybe another technology? Thanks!
I wanted to provide an answer to this in case anyone else was looking into this.
Essentially you pay 3 cents (0.03) per month per active user in each group. Basically you buy phone numbers for each group chat you need.
https://www.twilio.com/conversations/pricing
So if you're doing a million group chats obviously it can get costly, but for simple POCs this isn't the end of the world.
Enjoy!
I've built an app that receives events.
By default, the scope channels:history lets it receive events for all messages in all public channels of the user who added the app.
Ideally the user would be able to limit it to only some channels, right in app settings. (Any event the app receives will be made world readable.)
Right now I see 2 options:
The message event contains the channel id (not the name). So code can filter on channel, assuming there is a way to set it and the user trusts it.
Create a bot user (even though the app is read-only) that the user can add to specific channels.
Is there a better way?
If you don't want to use a bot user (your option 2) the only way is to filter out the messages from unwanted channels in your app. You will receive a message event for every new message created (including the ones sent from your app).
The message event does already contain the channel ID, so you can easily filter based on that.
Example: (Source)
{
"type": "message",
"channel": "C2147483705",
"user": "U2147483697",
"text": "Hello world",
"ts": "1355517523.000005"
}
There is no parameter in the event settings that allows you to choose the channels beforehand. But since this appears to be a reoccurring question, I would suggest to send a feature request to the Slack team about this.
I'm new using the Firebase Cloud Message. I built an IOS app to receive push notifications. The app works fine. I send messages from the Firebase console and they're displayed correctly.
Now I`m trying to build an web api to allow my customer to send the push messages (without accessing the firebase console). Studying the documentation here I realized that I've always to have a "to", meaning a group, topic or device id.
My question is: can I send a message to all devices (like I can do in the console)? I yes, how so?
Thanks in advance!
You can make use of topics. Given that all of your users are subscribed to a specific one. Just like what I mentioned here (removed some parts, just check them out if you want):
If you are looking for a payload parameter to specify that you intend the message for all your users, unfortunately, it doesn't exist.
Commonly, when sending notifications to multiple users, you can make use of the registration_ids parameter instead of to. However, it only has a maximum of 1000 registration tokens allowed. If you intend to use this, you can make batch requests of 1000 registration tokens each, iterating over all the registration tokens you've stored in your app server.
However, do keep in mind that Diagnostics for messages sent to Topics are not supported.
I found this:
!('TopicA' in topics)
With this expression, any app instances that are not subscribed to
TopicA, including app instances that are not subscribed to any topic,
receive the message.
So you could probably use
condition="!('nonExistingTopic' in topics)"
When testing iMessage applications in the iOS simulator, retrieving the MSConversation.localParticipantIdentifier in the two default conversation threads (Kate Bell, John Appleseed) returns the same NSUUID string because we are still on the "same device".
To implement a turn based app, I am passing the localParticipantIdentifier with the URL data to keep track of the participants' turns.
Person 1 would pass his ID in the message to Person
Person 2 would compare passed ID to her own to determine if she made the last turn.
Is there a way to simulate a unique localParticipantIdentifier between the two test conversations on the iOS 10 simulator? Besides hardcoding the "turn" info for debugging, I cannot think of a way to simulate this real world condition. Thanks.
Note: I do not want to use MSMessage.senderparticipantidentifier because the sender does not necessarily determine who made the turn (ex: user sends a message that updates the app state but is NOT a "turn", 3+ person conversation thread, etc).
Personally I would use remoteParticipantsIdentifier from MSConversation.
So the idea is to keep a reference of the latest move with the id of who did the move, and allow the user to play if its id matches with the list of remoteParticipants (and if he is the next on that list).
I am able to establish 1-1 chat by creating a room. I have used room because I will get history of last 50 messages (I would prefer more in number with paged results and expecting this feature in the near future).
I am unable to figure out how I can implement image and video sharing in between the text chat.
I also want this in the history I get. I mean I need to get the order of the text/image/video along with their details to display to the user.
When I upload an image file using Content module, the files are saved in a separate table in contents section (which is fine for user's gallery kind of app). But for chat we need to know who sent to whom and what (image/video/text).
I would like to know whether this is possible with the current version of the Quickblox sdk. or else is there any way we can establish this using Custom objects module? If possible, will this work if there are more number of users in the room? Please give me a solution to this.
If you want create chat with content, you need to use a Custom Objects. (in current QB version).
Advantage - you can also get chat history and implement deleting of message history.
But this method doesn't very simply.
At first you need create Custom objects represented next things:
single chat message
group chat message
(may be need create extended user profile)
At first, you can use QBChat module for changing service information between users.
When you need send message, you create Custom Object (CO) - message with parameters and upload it. When it uploading, you send service message via QB chat to your opponent user. When opponent will receive it, he should perform request for updating CO (in this case - single message).
As example, single chat message can contain next parameters:
opponent qb user id;
owner qb user id;
message text;
link to content;
Sending of content message divide to next steps:
At first, you need upload content file using Content module, and after this create message CO, upload it on server and send service message to your opponent