I have a Push-Notification service set up that I had to migrate (because IBM is closing the old service).
I used the original app and just opened a new Push-Service.
Now, when I try to test the installation with the REST-API online, it tells me that the app secret isn't valid.
Do I have to open a new app as well? (besides, I can't find the app-secret in the new interface)
What happens to the old mobile apps. Does the service run side by side for a while?
The app-secret value for the new push service is the VCAP credential, not an overall application secret like it was with the old services. The new services are more decoupled and thus only push requires the secret value at this time (added to prevent malicious usage of the REST API) and it is located in a different spot than in the old services.
Here are the steps to grab the app secret from your new push service instance (taken from: https://console.ng.bluemix.net/docs/services/mobilepush/t_restapi.html). Note where it says to click Show Credentials this is in reference to the new push service instance tile on your application dashboard's Connections tab.
With that said I highly recommend migrating completely from your app using the old services (Push, Mobile Data, Mobile Application Security) to a new app using nothing but the new services (Push Notifications, Cloudant NoSQLDB, Mobile Client Access). The services are not intended to work together cross-generation, and should be taken wholesale.
Related
I am implementing a VUE client app running on subdomain client.example.com and Laravel API on api.example.com. I am using webpush package to implement the browser notifications. I have my service worker (sw.js) on my vue app and manages to register the user, store the data to database on the push_notifications table.
The problem comes when I simulate the notification, it is not sent to the browser. I tend to think may be it is because the client app that requested for the permission is different from the API subdomain that triggers the notification.
Is there any way to implement this or my worries not realistic?
We need to develop something similar to OneSignal (only web, no native apps) for private use. Where can we start? Is there some open source project we can use?
Each browser implements their own Push Service, so using a private/custom Push Service necessitates re-creating (at least portions of) the Push & Service Worker API's to achieve similar behavior client-side. Google has a nicely-written high-level overview; see the "Who and What is the Push Service?" section of Step 2. It's also worth noting that while the Push Service itself may be created, you will lose the functionality the browser provides the web app (e.g. waking the service worker on receiving a notification, even if the web app isn't in the foreground), because the browser will only be looking to its own Push Service.
Outside the browser (e.g. an Electron app), you will still need to re-create (portions of) the Push & Service Worker API's to achieve similar behavior client-side. In this case, you're likely still better off using a native Push Service for the target platform, if available.
If content privacy is the ultimate goal: the WebPush protocol provides a means of encryption between the client and application server, so the Push Service can't read the notification content. This, combined with the acceptance of a standard Push API, makes using a 3rd party Push Service allowable for most scenarios, and trivial compared to building everything from scratch.
However, if you absolutely need to make a custom Push Service, Mozilla's Push Service is the only fully open-source solution I've found. It may not be exactly what you need "out of the box", but may be close. Only the client and admin SDK's are open-source for Firebase, so far.
I need advice as i am new in .net and azure, i am creating a architecture for a project which has its mobile application, web based admin panel and Website.
I am planning to host every thing in Azure. I am creating application in Xamarin. Application needs to have Push Notification, Offline Sync etc, features provided by Mobile App Services (Controller inherited from TableController).
I want to create 1 database which will be used by all 3 modules. I have already created a Mobile App Service and Database. Mobile application is using it as it was supposed to. Now i want to create a website and Web based admin panel and use the same database. Is this possible ?
What is the best way? Should i create a web project and perform operations on data via REST API? and use this API for Mobile Apps and Web based Backend?
I am really confused between different services from azure and which one to use. Should i use .Net Core or .Net. I need to know the best way to do it.
Edit 1 :
So far this is what i have done and i need to know if this will work fine in future when project get complex. I created database and back end via Azure Mobile App. Now i have created a .net MVC website and used RestSharp for CRUD operations in it. I have used the following code to perform the operations. Note the /tables/ part in the request url.
var client = new RestClient("http://xxxxxxx.azurewebsites.net");
var request = new RestRequest("/tables/request?ZUMO-API-VERSION=2.0.0", Method.POST);
string data = "{\"createdFor\":\"535862cf-e2b3-41de-99f9-88c47a77750c\",\"status\":\"IN_PROCESS\",\"createdBy\":\"7108147e-c11c-4d78-ac3d-d5d6c5eb78d0\",\"description\":\"Master room 5 door produces strange sound when opened or closed\",\"title\":\"Door Sounds Strange\"}";
request.AddHeader("Accept", "application/json");
request.Parameters.Clear();
request.AddParameter("application/json", data, ParameterType.RequestBody);
var result = client.Execute(request);
Console.WriteLine("Content " + result.Content);
Get and post operations works fine. Is this a good way?
Thanks in advance
As the official document mentions about Mobile App Features:
Authentication and Authorization (AAD,Facebook, Google, Twitter and Microsoft Account,Custom authentication)
Data Store (SQL Database, Azure Table Storage,etc)
Offline Sync
Push Notifications (Client SDKS seamlessly integrate with the registration capabilities of Azure Notification Hubs)
Client SDKs (A complete set of Client SDKs that cover native development, cross-platform development,etc)
Per my understanding, if the build-in features provided by mobile app could totally meet your requirement, then Mobile App is better for you and it would save your time. For Web API application, you need to do all stuff by yourself.
Now i want to create a website and Web based admin panel and use the same database. Is this possible ?
I assumed that you could create a Azure Mobile App application (Mobile App) and a web application (Azure Web App) under your solution, and you could extract the DbContext related classes into a shared class library.
Should i use .Net Core or .Net. I need to know the best way to do it.
For choosing between .NET Core and .NET Framework, you could refer to the official document about choosing-core-framework-server.
UPDATE:
Can you please take a look at edit 1, and suggest if this is the right way or it can create a problem.
Your code would work fine, since the mobile client SDK just wraps the common processing as your provided.
Note:
For accessing only by authenticated user, you need to add x-zumo-auth header with the authenticationToken after you logged.
Additionally, for your MVC application to retrieve the data from your mobile app (need authentication), you need to log with your mobile app and retrieve the authenticationToken for your subsequent requests against your mobile app. At this point, except for Custom authentication, otherwise you could only leverage Client-managed authentication and use JavaScript client library for Azure Mobile Apps in your MVC application for logging to mobile app and retrieve the authenticationToken, then you could send request from your front-end or pass the token to your back-end. For SPA, you could use both Client-managed authentication and Server-managed authentication.
Moreover, Adrian hall has wrote some useful tutorials about developing against azure mobile app, you could refer to Adrian hall's book.
UPDATE2:
For custom authentication using an Identity Database, you just pass the username and password to your mobile app, then it would validate the user info and generate the authenticationToken. While for Auth0, you firstly login with Auth0 provider, then pass the token to your mobile app.
My mobile application has its own signing up and sign in option with username and password.
For the connection Username-Password-Authentication from Auth0, it would manage the users for you, while using an Identity Database, the users would be stored in your storage and you need to manage them by yourself.
Per my understanding, both approaches could implement the custom authentication for you, but you need to choose the better one that matches your scenario.
I have backend(e.g. https://api.myapp.com) based on the Azure Mobile services(AMS), now I need
1. add one or two apis that doesn't require to be on AMS e.g. an heartbeat controller to check that service is online or not, that doesn't require Zumo Auth
2. an ASP.net MVC page(e.g. https://www.myapp.com) that explains about the application
Can I use the existing AMS to do this, I tried to add plain asp.net web api, but getting error that end point doesn't exist
Are you truly using Azure Mobile Services and not Azure Mobile Apps? You generally cannot have a custom domain on Azure Mobile Services. Since you mention ZUMO Auth 2, I'm assuming you mean App Service Auth and thus Azure Mobile Apps.
I'd recommend taking a look at Azure Functions for any APIs that do not require ZUMO. However, you can just add a custom API to your service. I cover all the options for you in my book - http://aka.ms/zumobook - chapter 4.
As to a service controller for checking heartbeat. If the intent is to ensure that the service is alive, then just create an unauthenticated custom API that tests the database connectivity (maybe does an SQL command to get the count of rows in your main table) and returns success or failure. You can then use Azure Functions, Azure Scheduler or OMS to do a query of that custom API.
I want to use datastore of google in my web app but do not want to host it in google app engine, I want to host it some other machine. So how i can use datastore in such web app ?
will it be more economical ?
You would need to follow the Accessing the Cloud Datastore API from another platform procedure:
This section shows how to activate and access the Cloud Datastore API
from an external application running on a platform outside of Google
Cloud.
Enable the Cloud Datastore API for the project. You can enable the API for an existing project, or create a new project and then enable
the API.
Enable the Cloud Datastore API
To use the Cloud Datastore API, your Cloud project requires an active App Engine application. Open the App Engine dashboard and
confirm your Cloud project has an active App Engine app.
Open the App Engine dashboard
Create an App Engine app if needed. The app must not be disabled.
Go to the Create service account key page.
Click the drop-down box below Service account, then click New service account.
Enter a name for the service account in Name.
Use the default Service account ID or generate a different one.
Select JSON in Key type.
Click Create.
Upon successful creation, your browser will download the private key. The Cloud Platform Console provides a prompt that displays the
private key file name. Note the file name so you can locate it, then
click Close to dismiss the prompt.
Your Service Account is the Email address displayed under the Service Account section.
Your Private Key is the file you just downloaded.
At this point all services and authorizations are configured for your
project and you can start writing code or exploring the API.
You don't actually need to write code for the GAE app and deploy it, see Is an App Engine instance required for accessing Datastore?
As for being more economical or not (I presume compared to running the app on GAE) - it depends a lot on the app's usage/scale, what the app does and how it does it.
Have a look at Cloud Endpoints
https://cloud.google.com/appengine/docs/java/endpoints/