Group PWA notifications on Android - c#

I'm using the WebPush c# assembly (v1.0.11) to send push notifications to my PWA.
My payload looks like this:
{
"notification":{
"title":"My Message",
"body":"Hello World, here is a message for you",
"data":{
"FromContactpersonId":"e3600a03-836e-4c01-42c7-08d879cb6c81"},
"badge":"assets/icons/badge72push.png"}
}
Now I want to group the notifications on android. If I set tag in the payload it will replace the last message, but I want them all to show, just stacked, like the e-mails in this example (compared to my own, which are not stacked):
I tried adding android_group but the messages do not get stacked at all.
How can I send them so they will be stacked on my android device?
Thanks, Sam

Related

How to use FCMClient to send messages to both Android and iPhone

Im using FCMClient in an MVC application to send alerts/messages to Android and iPhones.
I initialise https://github.com/tiagomtotti/firebaseNet/blob/master/src/FirebaseNet/Messaging/Message.cs and then send a message.....
var msg = new Message
{
To = token,
Data = someData
}
This sends alerts to an Android but not an iPhone. I looked at the documentation https://github.com/tiagomtotti/firebaseNet
and can see two classes AndroidNotifcation and IosNotification (https://github.com/tiagomtotti/firebaseNet/tree/master/src/FirebaseNet/Messaging)
I now noticed the Message class takes in an Interface for both notifications but how could setup the Message class to take in a notification but targets both Android and IoS?

Telegram Bot API C# How to get All Pinned Messages?

Telegram added the feature to pin more than one message. I'm doing it like this:
var chat = botClient.GetChatAsync(chatid).Result;
pinnedmsgtxt = chat.PinnedMessage.Text;
pinnedmsg= chat.PinnedMessage;
but I can only get the last message that was pinned. Any way to get all of them? Am I missing something? I'm using https://github.com/TelegramBots/telegram.bot
Use messages.search method with inputMessagesFilterPinned filter.
Please read more here:
Pin API
Message Search API
Pinned messages filter

Send simple text message to wechat user from server side

I have wechat app on Android, in Settings->MyAccount I set WeChat ID "my-wechat-unical-id".
In WebForms project I add WeChat.SDK 1.0.1.9
now I obtain ACCESS_TOKEN like this:
https://api.wechat.com/cgi-bin/token?grant_type=client_credential&appid=my_appid&secret=my_secret
How I can to send simple message to 'my-wechat-unical-id' if this person is not my follower, can I send to him some message or notification in wechat?

Ionic sending Parse push notification with attached url

I've been busy with a new application based on ionic. It's a new environment so I have a lot to explore.
I'd walked into some problems and search over the whole internet to find a solution and couldn't find one solving my problem. So I hope one of you guys know a solution.
I am trying to send notifications to my device using parse. That works fine, but now I want to send an uri attached with it, so that I can open a specific page clicking on the notification that has been recievied.
The problem is that I have no clue how to correctly send an attached uri and recieve that uri on the device to do something with it.
I hope some of you knows a solution.
I'm using ASP.NET to send the notification with a working initialized client.
var parsePush = new ParsePush();
// sending to all with your own data
parsePush.Data = new Dictionary<string, object>
{
{"alert", txtMessage.Text},// this is replacement for parsePush.Alert
{"sound", "notify.caf"},// for ios
{"badge", "Increment"}// for ios notification count increment on icon
//{"category", "http://google.nl" }
};
parsePush.SendAsync().Wait();
For the ionic side I don't have an event to recieve the notification and work with it. I just get the notification and get redirected to the home page of the app.
Please inform me if there are unclear details.
Thanks a lot!
I fixed this problem by searching over the whole internet.
The first thing I did was uncommenthing the category in my parsePush.data on the server side (see code in the question). In the category I define the uri. The next thing I did was adding "ParsePushPlugin.on" to my app.js. Those event are used when a notification is recieved or opened.
I added this code to my app.js inside the .run -> $ionicPlatform.ready.
ParsePushPlugin.getInstallationId(function (id) {
alert(id);
storage.set('parseId', id);
}, function (e) {
alert('error');
});
ParsePushPlugin.on('receivePN', function (pn) {
alert('yo i got this push notification:' + JSON.stringify(pn));
});
//customEvt can be any string of your choosing, i.e., chat, system, upvote, etc.
ParsePushPlugin.on('receivePN:chat', function (pn) {
alert('yo i can also use custom event to keep things like chat modularized');
});
ParsePushPlugin.on('openPN', function (pn) {
//you can do things like navigating to a different view here
//alert('Yo, I get this when the user clicks open a notification from the tray');
$state.go(pn.category)
});
As you can see "ParsePushPlugin.on('openPn')" has pn as parameters which contains all the data from the recieved and opened notification. This notification also contains the "category (uri)" which is passed from the server side.

Sending SMS with delivery message

How can i write code for send SMS with delivery message in Windows Mobile? please guide me with C# or C++ code.
I want to use SmsSendMessage API in this code because this API have more features.
You could use SmsSendMessage to send the message and use SmsGetMessageStatus to get the status report of the sent SMS. This is all C++ code, but you can pinvoke it as well.
Microsoft.WindowsMobile.PocketOutlook Namespace
The Microsoft.WindowsMobile.PocketOutlook namespace provides classes that allow you to create and access PIM data items (Appointments, Tasks, and Contacts), and MAPI messaging items (e-mail and SMS messages), on mobile devices
SmsMessage Class in msdn
This sample shows how to send an SMS message to a mobile phone.
public void SmsMessageSend()
{
SmsMessage smsMessage = new SmsMessage();
//Set the message body and recipient.
smsMessage.Body = "Would you like to meet for lunch?";
smsMessage.To.Add(new Recipient("John Doe", "2065550199"));
smsMessage.RequestDeliveryReport = true;
//Send the SMS message.
smsMessage.Send();
return;
}

Categories