OneSignal Push Notification - Doesn't work on WP8.1 - c#

Just created a project today, added with this references:
https://documentation.onesignal.com/v3.0/docs/windows-phone-sdk-setup
Toasts and Internet Services are enabled.
I've inserted the OneSignal.Init code sample to the OnLaunched event and changed the ID to mine.
My solution associated with store.
Debug/Release mode:
New users successfully registered to my app. (I can check them in the Users menu on my OneSignal Dashboard.)
My problem:
When I'm trying to send a Push Notification to all users, the website(OneSignal) just keep sending. I've tried it on 4 WP emulators, but I didn't get notifications.
Anyway, Microsoft Azure Notification HUB works fine...
Software: VS 2015 with every update installed.
If anyone knows what I've missed, please help me:)

Solved!
On Windows Dev Center -> Your App settings -> Services -> Push Notifications -> WNS/MPNS -> Live Services site!
Generate new Secret Code, and then activate it. (Use it on the Dashboard of Onesignal App Configure)
Onsignal SDK: Using the notificationOpened event is must have!
After that, you can the notification when the app isn't in focus.
To see that while using the app, you should create a local toast notification with the datas from Onesignal event.

Related

Send a notification to user when database is updated Azure Notification Hub

Let me explain my problem :
I have a MySQL database (That I launch with WAMP) where I store all my data and a UWP Client application.
I would like to send a notification to the client when my database is updated so the app can reload the data stored inside it's variables.
I've seen some solutions, but i wanted to try to use the Azure Notification Hub to do this project. I created a Notification Hub and an app in the Windows Notification Service.
I successfully sent a notification to myself using the app, but now I would like that the process of sending the notification to be automatic when a trigger in the database is called.
I saw a plugin named SYS-UDF that can lauch commands from SQL using functions like "sys_eval" or "sys_exec".
So i created a console app that I think was able to send a simple push notification. But I encountered a problem : I can't use a console app to launch a push notification, that is because it is not published in the WNS and it can't be published, because it's a console application.
So I'm stuck, here. Is there any other ways to send a notification to Azure Notification Service ?
Thanks in advance for your answers.

Launching an application from another using the wrong app.config

All our custom applications are currently accessed by staff via a custom Toolbar Menu (not built by myself). This is built using vb and uses the line
Process.Start(FileToLaunch, params)
The issue I have is I have built an Application that can send push notifications to mobile devices (This is built with C#, WPF, MVVM, XAML), and it must use its own app.config for these push Notifications to work. This application works perfectly when running it directly by clicking on its .exe the push notifications are all sent successfully.
On launching it from the Toolbar Menu Application via the line of code above, the Notifications Application is looking for the config settings in the Toolbar Menu folder instead of the Notifications application.
This is then causing the following error when sending notifications.
There has been an error, which has been logged.
Error Message: Validation failed for one or more entities. See 'EntityValidationErrors' property for more details
My colleague says that the only way they have dealt with this in the past is to add all relevant config settings to the Toolbar Menu Application app.config.
This does not seem like a good way to work.
If you have any suggestions on how to get the application to launch using the correct config I would be most grateful.
Also please just ask if you need any further information.
Thanks

How to Use Azure Notification Hub without updating IOS Application

I am working in Azure notification hub, and the notifications send to the IOS applications. Following ,
https://learn.microsoft.com/en-us/azure/notification-hubs/notification-hubs-ios-apple-push-notification-apns-get-started
But the problem is my IOS application currently using about 1000 users. So the users do not want update his app. The question is - any option to implement Azure notification hub in IOS application without updating the App.? In my hand device Id stored in DB. And also I have certificates.
I think write a console application and add all device id to azure notification hub. Is it possible?
Per my experience, it seems to be not possible to migrate from APNS to Azure Notification Hub for your iOS app without any code changes, because you must have to add the Nofication Hub ListenSharedAccess connect string into your app project. Actually, the architecture migration for your app is from Fig 1 to Fig 2, as below, it will cause necessary code changes. Unless there is some mechanism of hot-patching in your app, but it was not allowed by Apple.
Fig 1.
Fig 2.
Yes, you can register all your existing device tokens with the Notification Hub using the API of your choice. Then have your app back-end register new tokens with the notification hub as they come in.

Background raw push notifications is received from server in Window Phone 8.1

I want to execute my own function when a push notification (raw message from azure) is received even when the app is not running. And the user doesn't need to click the notification in action bar.
i tried this way "Execute some function after raw push notifications is received from server in Window Phone 8.1"
but i am not getting background event, even azure send raw message successfully, but toast message is working
i registered my appname at MS development dashboard , and i tried windows phone silverlight 8.1 and runtime too...
Please help me thank you in advance.....
After long research , I can able to get raw notification from background, this time i am used MS push sample server (http://pushtestserver.azurewebsites.net/wns/) which needs URI,Package Security Identifier (SID) and Client Secret.
(universal app)
URI you can get form app
var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();
string uri = channel.Uri;
Package Security Identifier (SID) and Client Secret can get from developer dashboard (you should have developer account to get dashboard)
Right click on your WPproject 'store->Associate App with the Store...' follow instructions... (https://azure.microsoft.com/en-in/documentation/articles/notification-hubs-windows-store-dotnet-get-started-wns-push-notification/) check for 'Register your app for the Windows Store'
Set Tost capable 'yes' and Lock screen notification is 'badge or badge/Tiletest' in Package.appxmanifest
(Windows phone 8.1 Silver light)
1 and 2 same as universal app
'store->Associate App with the Store...' not available for silverlight project to associate app fill your package details with your dashboard registered app details (try to upload you xap file in to store will give you where you are not matched with account)
4 same as universal app
Hint: Raw notification sample form Microsoft is not fully implemented for windows phone, to work for windows phone please create background project and add reference to your windows phone project.

Sending Push Notification to Windows 8 Metro style app in C#

I've downloaded the Microsoft sample code for registering your app to push notifications to. Sample
I have sent the channel URI to myself in an email, and I believe I have all the relevant information to actually send a push. But I've never dealt with the server-side sending of a push notification.
The sample app should just output whatever I send.
I can't find any pre-existing apps to help me. I just want to be able to see some information in the sample app window. From there I should be able to figure out what to send in future, headers, etc.
Is there a sample app, where I just put in the Channel Uri, token, SID and secret, and it'll send something like "Hello world" to my app? Preferably with source, so I can take it apart and see how it's being done.
Take a look at the tutorial for the Windows Azure Mobile Services Push Notification:
http://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started-with-push-dotnet/
I will second the recommendation for Windows Azure Push Notifications, with another blog overview (using JavaScript) here
If you do want to get under the hood a bit more the reference pointed to above - http://watwindows8.codeplex.com/ - does work with RTM; however, the setup is coded to work only with the Release Preview.
If you'd like to set it up you can do the following:
In Setup\CheckW8.ps1 change the build number in text from 8400 to 9200
$os = Get-WmiObject Win32_OperatingSystem;
if ($os.BuildNumber.Equals("9200")) {
exit 1;
}
...
Then in Setup\DependencyChecker\WATWindows8.depi, delete the three <dependency> sections entirely. The assumption here is that you already have Visual Studio 2012 RTM, the Azure Tools for 2012 RTM, and NuGet is up to date.
When you run the setup as instructed by the Toolkit, it should now work. You'll get an empty list of dependencies, but that's fine since you've already installed them manually.
The C# Push Notification sample code should be fine on a recompile (you'll get an error about the package name, but that's expected since it's part of the configuration you need to do).
For the JavaScript version, you'll have to patch the script references to the RC version in default.html, remove the old "Window Library for JavaScript" from the references and add the new one.

Categories

Resources