Does Notification Cloud URI have any limits? - windows-phone-7

I have working with Push Notification in WindowsPhone. I'm able to send the Notification from the server and receive it in Windows Phone.
I'm using the url for cloud generated by the below code. Does any of you guys knows is there any limitation for this url like time limit or licensing etc..
Since when my app is get launched we need to create n no of url for the every user.
/// Holds the push channel that is created or found.
HttpNotificationChannel pushChannel;
// The name of our push channel.
string channelName = "ToastSampleChannel";
InitializeComponent();
// Try to find the push channel.
pushChannel = HttpNotificationChannel.Find(channelName);
// If the channel was not found, then create a new connection to the push service.
if (pushChannel == null)
{
pushChannel = new HttpNotificationChannel(channelName);
// Register for all the events before attempting to open the channel.
pushChannel.ChannelUriUpdated += new EventHandler<NotificationChannelUriEventArgs>(PushChannel_ChannelUriUpdated);
pushChannel.ErrorOccurred += new EventHandler<NotificationChannelErrorEventArgs>(PushChannel_ErrorOccurred);
// Register for this notification only if you need to receive the notifications while your application is running.
pushChannel.ShellToastNotificationReceived += new EventHandler<NotificationEventArgs>(PushChannel_ShellToastNotificationReceived);
pushChannel.Open();
// Bind this new channel for toast events.
pushChannel.BindToShellToast();
}
else
{
// The channel was already open, so just register for all the events.
pushChannel.ChannelUriUpdated += new EventHandler<NotificationChannelUriEventArgs>(PushChannel_ChannelUriUpdated);
pushChannel.ErrorOccurred += new EventHandler<NotificationChannelErrorEventArgs>(PushChannel_ErrorOccurred);
// Register for this notification only if you need to receive the notifications while your application is running.
pushChannel.ShellToastNotificationReceived += new EventHandler<NotificationEventArgs>(PushChannel_ShellToastNotificationReceived);
// Display the URI for testing purposes. Normally, the URI would be passed back to your web service at this point.
System.Diagnostics.Debug.WriteLine(pushChannel.ChannelUri.ToString());
MessageBox.Show(String.Format("Channel Uri is {0}",
pushChannel.ChannelUri.ToString()));
}
Thanks in advance.
Thanks
Kamal.

As I know, there are only three limits with Push Notifications:
MPNS allows both unauthenticated and authenticated notifications. However, unauthenticated push requests are throttled if they exceed 500 messages per day (per device). There are no such restrictions on authenticated requests which uses client SSL for authentication.
1 notification channel per application
Maximum notification channels on device are 30

Related

Spring WebSocket can't send message to authenticated user when pass jwtToken in header

1. scenes to be used
When connect WebSocket is permitAll
Then Subscribe /user/queue/userInfo need user authenticated
After subscribe success, send to /app/user/info need authenticated(Because I need get userInfo ), and push message to current user subscribe queue /user/queue/userInfo
2.1 Details description after I trace the source code
1) when subscribe /user/queue/userInfo with the jwtToken in header, I get the jwtToken, then get Principle user object from auth server with jwtToken, then set user in StompHeaderAccessor.
At last, the user subscribe lookupDestination is /queue/userInfo/user{sessionId}
2) Then send /app/user/userInfo with jwtToken in header, after handle the return value,
the final send destination is /user/{Principle.getName()}/queue/userInfo.
the user never subscribe this queue: /user/{Principle.getName()}/queue/userInfo, and the message cannot send to user

Ionic 3: endpoint request return to a page - how to

I'm using OneSignal (in Laravel) to send notifications to my Ionic app.
When a user sends a message via web to another user, OneSignal pushes a notification to the receiver. This notification should open the messages screen. Instead, it is opening a browser window with the endpoint return, a JSON.
Here's how I create the push notification (endpoint):
\OneSignal::sendNotificationToUser(
$request->get('mensagem'),
$notification->notification_id,
$url = url('api/mensagens/show-messages?remetente='.$remetente.'&destinatario='.$destinatario.'&auth_id='.auth()->user()->id),
$data = null,
$buttons = null,
$schedule = null
);
So, when I send the message, I'm receiving notification in my app as expected. When I open the notification, I get this.
What am I doing wrong? How to call the messages page correctly when I click in the notification?

Getting two many push notifications from google calendar api after an action

I am developing an app that syncs with my google calendar with my database.
I Have everything running, but I have a problem.
Every time I do an action (add, delete, update) on my google calendar I receive multiple push notifications for the same event, and after a few events, I get blocked by Google services (403-user-rate-limit-exceeded).
to every notification i am answering with the proper status code, here is my code:
[HttpPost, Route("notifications")]
public HttpResponseMessage Notifications()
{
try
{
this.googleCalendarService.PerformEventsSync();
var response = this.Request.CreateResponse(HttpStatusCode.OK);
response.Content = new StringContent("200");
return response;
}
catch (Exception e)
{
log.Error(e);
return this.Request.CreateResponse(HttpStatusCode.InternalServerError);
}
}
Ok, so i found what was going on.
Turns out that while I was debugging and deploying my app I was creating multiple watch channels.
What i did:
Created a variable to save my active channel id and it's expiration time
On each received notification I retrieve the header "X-Goog-Channel-ID"
Before preforming my sync I assure that its comming from the correct channel (my app can only have one channel)
When my expiration time is coming to an end I refresh my channel
Thank you

How to avoid 'Choose Account' screen with Google Calendar API?

Our app is importing the next 1000 events from a user's Google calendar API. We ran into the problem where nginx would timeout. To get around this I'm putting the pagination data into a session variable and making separate HTTP requests to the API. This works except for one problem: every time we make a new HTTP request the API asks the user to choose which account they want to use (one user with multiple gmail accounts). I would have thought that the pagination data would include account selection but this is apparently not the case. How can I programmatically select the email account within the HTTP request?
You can store it once
public static void setmCredential(GoogleAccountCredential _mCredential) {
mCredential = _mCredential;
mService = new com.google.api.services.calendar.Calendar.Builder(
transport, jsonFactory, mCredential)
.setApplicationName("YourApplicationName")
.build();
}
And then when caliing pass it like this
new MakeRequestTask(AccountCredential.mService).execute();

Windows Store App Push Notifications via Azure Service Bus

I'm trying to send a push notification to my Windows Store App developed in my laptop using VS 2013 Express. It's been few days now but I cannot figure out why I get "The Token obtained from the Token Provider is wrong" error. I use Windows Azure Notification Bus for this purpose. I use VS Server Explorer to send test notifications. I can see my laptop is being registered as a device in the Device Registration tab too. I tried the Azure portal as well, but the same error. However, when I try to connect to Service Bus Explorer 2.4.3.0 providing the connection string it throws below error.
<21:47:14> Exception: The remote server returned an error: (401) Unauthorized. Manage claim is required for this operation..TrackingId:c0c4fea2-08bc-4def-964c-ec6e690b7551_G45,TimeStamp:10/12/2014 4:17:11 PM. Method b__7e: retry 2 of 10.
FYI: I'm following below article step by step.
http://azure.microsoft.com/en-us/documentation/articles/notification-hubs-windows-store-dotnet-get-started/
Please help me. Thank you.
Mahesh
Looks like token is just expired. Make sure you obtain token each time application starts. In terms of the article you refer it means you should call method InitNotificationsAsync() to do it. Here is that method:
private async void InitNotificationsAsync()
{
var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();
var hub = new NotificationHub("<hub name>", "<connection string with listen access>");
var result = await hub.RegisterNativeAsync(channel.Uri);
// Displays the registration ID so you know it was successful
if (result.RegistrationId != null)
{
var dialog = new MessageDialog("Registration successful: " + result.RegistrationId);
dialog.Commands.Add(new UICommand("OK"));
await dialog.ShowAsync();
}
}

Resources