Is it possible to set up an own push service within an intranet? - web-push

I would have asked this in a follow-up comment to this comment but my reputation is still too low.
So here are the questions: Is it possible to change the endpoint URL of a browser or to add an endpoint URL so that my application can send its POST request not to a web service owned by the browser manufacturer but to a web service that runs inside my intranet? As my application is run in an intranet without connection to the internet a customized browser wouldn't be a perfect solution but it would be possible.
And now for the 2nd part: If it is possible - are there ready-to-use push service libraries for PHP? So far all I've found are libraries that let an application send notifications like https://github.com/web-push-libs/web-push-php.

Is it possible to change the endpoint URL of a browser
No, currently it is not possible to change the browser push service.
And in any case you would also have to run an instance of the browser push service on your own servers (e.g. https://github.com/mozilla-services/autopush).

I think in this case you can just use any transport like web sockets, for instance and a notification API to show it to the user. Not sure if persistent connections will work within service worker context, but this should not be a problem if you're still customizing a browser.

Related

Azure Web App Service / Rest API - How to upload a website page

I have a web app service on azure that is hosting a RESTful api which deals with my MySQL database. I am wondering if its possible to somehow (either manually, or otherwise) upload a page to this app service as well. For instance, i have my URL from azure, and my API lives under /api
I was wondering if i can create a php/html page or something that I can upload to /meetingConfirm
so i can do something like /meetingConfirm?id=hash
And have a page which i can send email links to encoded for each meeting, to allow people to respond to invites. It would be a simple page that just updates a value via the API and then displays a confirmation.
For this, you don't need a separate page to be uploaded for each user. You can just add a multi-threading Id generator code and save the last used Id in your DB for future requests.
I am referring to a solution like this(as I am not sure about your tech stack, sharing python approach): How do you generate random unique identifiers in a multi process and multi thread environment?

Add "about:blank" to Azure Mobile Service CORS whitelist

I am trying to load content in a WebView in my Windows Phone 8.1 RT app. As per requirement, I need to fetch the content from database and render it in the WebView. The content is essentially an HTML document (with inline javascript and CSS) saved as a string in database. It also makes connection with mobile service.
I have added * in my mobile service's CORS whitelist. I also added null after discovering that it was required for the app's android and iOS counterparts.
I am using NavigateToString() method of WebView. It is not able to fetch data from azure because it sends about: as origin in the request header (possibly from about:blank). I need to add about: in whitelist but it won't allow because it says it is not a valid hostname. I added about* with no success. What should I add in CORS whitelist now, considering I already added *?
I'm assuming (slightly) that this is a WinJS application. It actually has nothing to do with Azure or your Mobile Service. It's got everything to do with the requirements within a WebView.
Review: https://msdn.microsoft.com/en-us/library/windows/apps/hh465373.aspx
That link provides the yes/no for your request - in a WebView you are doing a Web context. Note explicitly that you are doing Cross-Domain XHR requests are those are explicitly forbidden.

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.

WCF service not invoked by client

I am working on my first WCF service and i am not sure why there are no results inspite of doing every correct.
Created a WCF service.Added a .svc page as well and now i can publish and browse to my service as well when it is hosted on IIS. Now i add service reference into a simple console application and create client object, provided values mandated by the data contract and then i do client.Operationname().
What is supposed to happen is that my service is supposed to send an email out to the email address i provided during my testing with a confirmation message.But that does not happen.
I enabled logging using SvcConfigEditor on the published config file, but there is no log entry.
I checked the logs of smtp and nothing is there as well.
I am running out of ideas as what else can i do to make sure that i am able to send out the confirmation email to the customer using my service. Also my service does work when i have it published on local machine.
Try to use WcfTestClient.exe from Visual Studio.Net Command-line to help simulate the client. then, You can debug the server side code.

Handling Top-Level Domains in Multi-Tenancy Web Applications

So i'm in the middle of defining the architecture for an application I've been waiting to start and have hit a bit of a bump. I 'm having a bit of a hard time figuring out how to handle multi-tenancy in conjunction with Top-Level domains.
Here's the gist of what I am trying to accomplish:
Users can come to the site and register for an account, when they register they can set up the application to use their own registered domain name. I'm not handling registrations (but do provide good instructions on how to register and point the domain for most Domain Registration companies) just the application end of it.
What I am having a hard time figuring out is how sites like Wordpress.com and Typepad handle the multi-tenancy at the application level.
So say a request comes in for www.test.com/ it reaches my multi-tenancy application but how do I serve the correct site? do I pull the headers from the request and serve a site based on that.
For instance if you were using Apache as your web server for your application, there's no way you would be adding virtual host config to apache every time a person registered for the application with a custom domain. So they have to be handling it programmatically but I can't seem to find any resources that are clear about how to handle the multi-tenancy of top-level domains at the application level.
General idea is not that difficult. When request gets to your application you have to parse url and get some tenantID from that. Similar question in asp.net mvc 3 was asked on question. You'll find my answer there with solution in our application. On sites like wp or similar i believe that proxy is adding some http header data to request so the application layer already gets tenantID.

Resources