Receive push notification in Windows 8.1 - windows-8.1

I am developing Windows 8.1 Application and want to implement push notification using WNS.
I have updated my app to dashboard and also associated my app with app store . I followed Push and periodic notifications client-side sample.
I debugged this sample and found the channel URI (notify.....com) .I am trying to get my app channel Uri but I am not able to get any Uri .I think I am not implemented properly.
Please help me to troubleshoot this issue and share some idea for the below points.
How to associate Windows 8.1 App with App Store.
How to enable Push Notification Service using WNS ( any other procedure also).
Local Configuration.
How to get channel URI.
link
Please find the error on the below attached image.

How to associate Windows 8.1 App with App Store.**
In your store dashboard navigate to the particular app and on the left you will see a list having items like analyitcs,services etc. Click on services->Push Notification. Then click on the live service site. See Screenshot
Then update your solution with Name and publisher. This should set you up. and also take cares of question 2 and 3 of your post.(Associating your app from store should do this automatically once you have enabled push from dashboard)
And to get channel URI just call the following method in your code:
PushNotificationChannel channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();
var myuri = channel.Uri;

Related

Unauthorized: Your bot is not configured to interact with LUIS app

Working with the Azure enterprise bot model, everything is deployed, enabled and functioning. But all calls to LUIS are failing in the chatbot, both on desktop and in Azure's web environment. My LUIS model works in luis.ai when testing, but when connecting to LUIS from the bot I get the error below:
The only thing that does not work is the call to LUIS from the chatbot. It returns unauthorized. I've spent about 8 hours on google and verifying settings. Can somebody tell me where the checkbox is that i've missed?
Basic chatbot function is good.
microsoft app id and secret are good.
QNA maker implementation is good.
Publish cycles from Visual Studio is working fine.
I have verified the LUIS app functions in luis.ai.
I have verified all keys are properly written in cognitivemodels.json
I have verified all keys are correct by changing them incrementally, noting that the app fails, restoring to the correct value, and noting that the app functions.
trace results:
App ID:
Version: Unknown
Slot: Production
Recognizer ResultRaw Response
{
"recognizerResult": {
"alteredText": null,
"entities": {
"$instance": {}
},
"intents": {
"l_general": {
"score": 0.6153312
}
},
"text": "test"
}
}
Top-Scoring Intent
l_general (0.6153312)
Please add your LUIS service to enable reassigning.
Entities
No Entities
error from emulator log:
[LUIS] Unauthorized: Your bot is not configured to interact with LUIS app: . Please connect your bot to LUIS using the services pane.
The service pane appears, I add in all the keys and information as copied from luis.ai for the referenced appID. On save, the pane disappears and nothing changes.
This error looks to be specific to the Bot Framework Emulator as per this code.
I can reproduce the error locally by doing the following:
Debugging my bot.
Submitting a query that will trigger a request to LUIS.
Clicking on the hyperlinked trace text next to a LUIS Trace log entry in the log pane.
You aren't actually able to add a service to a bot without creating a bot configuration first (File > New Bot Configuration). Fill out the following:
Bot name
Endpoint URL (use your local one)
Microsoft App ID
Microsoft App password
Save and connect
Save the configuration somewhere
Then you will be able to add the services:
Click the + next to the Service.
Add your LUIS apps by filling out the dialogs.
Try the steps in the first set of my bullet points again and see if errors come through. If they do then you will need to add a service for the GUID that comes back in the error message - this GUID will match one of your LUIS app ids.
Even after doing this I still got the error message in the Log page, starting the emulator and bot didn't help. So I would advise raising an issue on the official GitHub for the Bot Framework Emulator about adding the services not working.
My AD password changed, Powershell had cached my credentials. Although I was not actively using powershell, apparently my credentials are locally cached on the dev box and used for some specific funcitons, which manifests as seemingly random authentication errors in logs. logging out of azure and logging back in (in powershell) resolved the issue.
Oh the hours of my life I will never get back.

Impossible to choose any channel in Azure Bot Service

Since the new Azure Bot Service (released GA 2017-12-13), I've created a "WebAppBot" named "SanoBot" and I can't choose any channel to plug it for another services like Telegram: the page is empty when I click on "Channels". I've done a little screenshot to show you what I see:
I've check the documentation sent by the Azure Support from Twitter but the pages return 404 error.
Just to be clear: the bot works well and I can modify it from the Online Editor, build, deploy & test it. It's only "channels" feature that doesn't work.
Thanks for your help.
I can't use pictures because I haven't enough reputation...

Azure Easy API on Node.js 'No route registered for '/api/xxx'?

I'm having problems even running a simple Easy API method. I keep getting the response that says "No route registered for '/api/userInfo'".
I know that this location is correct because the I'm opening the App Service editor at https://XXXX/dev/wwwroot/api/userInfo.js
The file also has anonymous access, so there shouldn't be an authorization issue. I'm simply trying to hit the api method from a browser.
The code of this very simple method has been reduced to the following for debugging purposes
module.exports = {
"get":function(){
console.log('whooohooo');
}
};
Is there a setting I'm missing to enable the ability to call Easy API's? I've not been able to find any documentation that states that Easy APIs method must be explicitly enabled, nor can I find any settings related to enabling them.
Please note that I did not set up a Node.js project and deploy it to Azure. I am using an "out of the box" app service.
My end goal is to use an Easy API method go get an authenticated user's email and name, but my efforts have been reduced to confirming that I can call a method. Thanks in advance.
UPDATE:
I've created 3 different mobile App services with no luck and varying advantages.
App Service 1:
This Mobile Apps project is 10 months old and was created in the Azure portal. It has a routing line in the app.js file that suggest that the api route should be present, but doesn't work. I don't remember if i authorized the easy apis when i created it, but the fact that it has the following line suggests that I did
mobile.api.import('./api');
AppService 2:
This project was created in the MobileCenter using the Tables menu option for a Xamarin project. I then navigated to the Azure Portal and hooked up a SQL db to the table. I don't think I had the opt in to use Easy APIs, but the I was allowed to create an Easy API script, then edit it. Upon editing it, I realized that the project had no app.js file. Apparently web apps created via MobileCenter are created differently.
I picked this option because it allows you to use the "per-user" flag when setting up tables and doesn't require you to manually filter out data with a modification to the table's script. Apparently this is not an option if you don't set up an App Service via the MobileCenter??
App Service 3:
I created a brand new project within the portal and followed the the steps Aaron Chen laid out. I opted in, hooked up the table and modified the js file (I created a new one called 'testing'). I browsed to https://zzzzapitestzzzz1.scm.azurewebsites.net/api/testing
and got the dreaded no routes found error. Of course, the API method was created with anon access rights.
Basically, we can easily create an Easy API in the Azure portal.
Select your app service and click on Easy APIs in the MOBILE menu.
Enable Mobile extension for your app by clicking Need to configure Easy Tables/Easy APIs ...
Connect a database and then click Initialize App button.
After app initialized, you can add an API from Easy APIs blade.
Change the userInfo.js file to something like this:
Now, we can access the API with the endpoint http://<yourappname>.azurewebsites.net/api/userInfo.
For more info, please refer to this blog post.

Push notification - Server API Key

We have been using GCM to send Push notifications for a long time, in the past days, the sending log starts give me the error:
The Push Notification System rejected the request because of an invalid credential
After searching on the web, it seems that a Server API Key is now required to get service working again.
The API Key was created and restricted to IP of my production server on Amazon.
When I try to register the Server API Key in Azure GCM, I got an error 401 unauthorized.
Can anyone give me any suggestion? I don't know what to do anymore, my users can't access our system because authentication token is not being sent. Thanks.
Screen errors:
There is now a visible note in the GCM docs saying:
Starting from Sept. 2016 new server key can only be created in the Firebase Console using the Cloud Messaging tab of the Settings panel. Existing projects that need to create a new server key can be imported in the Firebase console without affecting their existing configuration.
Migrating from GCM to FCM fixes the issue for 401 Unauthorized Error.
If you are just starting to use GCM, instead of creating a project in the Google Developers Console, do it in the Firebase Console. After creating the project, simply use the auto-generated Server Key. Here are the steps where to find the Server Key:
Go to your Firebase Console and click on CREATE NEW PROJECT.
Fill in your desired Project Name and select your Country. After this, the new Project should be active.
Then on left-side panel, click on the gear button and select Project Settings.
Then go to the Cloud-Messaging Tab.
For old GCM projects, you can simply Import the project to the Firebase Console:
Go to your Firebase Console and click on IMPORT PROJECT.
Select the project you want to import and your country.
Click on ADD FIREBASE. After this, the new Project should be active.
Then on left-side panel, click on the gear button and select Project Settings.
Then go to the Cloud-Messaging Tab.
See my answer here for more details.

Can I determine if app was installed via Facebook Ad?

Is there a way to determine if the currently running app was installed via Facebook ad?
I am currently calling [FBAppEvent activateApp] in my app delegate's applicationDidBecomeActive selector. I'm not using any other Facebook SDK features.
I would like to distinguish users that arrived via a Facebook ad. Is there any way on the phone to determine that an app installation came from a Facebook ad?
Here is the response I got from Facebook developer support on this issue.
Unfortunately this is not currently possible using the SDK. As per the docs, we only send information on when someone installs the app.
https://developers.facebook.com/docs/ads-for-apps/mobile-app-ads
"After installing the SDK, include the following code to be executed when your app is in the foreground. This will allow the app to ping back the install event to Facebook when the user opens up the app for the first time, and again in the future if there is a network error. Our client code will stop sending installs once it acquires a success code from the server, and our back-end will only count the install a single time if it receives multiple hits for the same device"
I hope this helps.
Thanks
Yes, there is. It isn't as easy as you would hope, but this is what you do.
Look in your logs on your server to see when someone's clicked through an ad
Find the IP address connected to that request I.E 8.8.8.8 (Google OpenDNS, if you're wondering).
look for the same IP address of someone who accesses the page after they've installed the app. If you find a match, your ad worked.
write a python script or have me write a python script to do this automatically.

Resources