Redirect IOS app service calls to different environment services - api

My iPad app is developed by third party and it is calling my restful services for registration and login.
Now I want to launch iPad app from XCode project which is pointing to old service URLs and redirect service calls to invoke new service URLs without modifying the code.
Ex: login request coming to http://xx.com/login and redirect to http://xx.com/services/login by interpreting some tool.
Please advice me or let me know if there is any better approach.

http://www.charlesproxy.com/ is what you want. This lets you breakpoint, forward, and do any kind of crazy stuff with your requests. Install on your mac, put it in the same wifi as your phone, and use your mac's ip as proxy.

I used MapRemote to redirect the url in Charles.
Had set Map from and Map to columns.

Related

Sonos API Redirect URI with external controller

I would to know how to create Redirect URI if I want to control with the external control instead of application or web.
When you say "external control", I guess you mean something like a hardware controller? In that case, you'd have to have some kind of app or web site to set up the hardware controller. You'd use this app to execute the Sonos authentication, and in this case, the redirect uri would be handled by that app or web site.

How to reduce Worklight application url?

How to reduce below worklight application url to shorter form?
For ex: My application url is //hostname:ipaddress/projectName/apps/services/preview/projectNameApp/common/0/default/projectNameApp.html"
I want to set up a url which can be accessible easily over the internet. what are the settings required to get shorter url in worklight project
For ex
//hostname:portno/context path/appIndexPage.html
instead of
//hostname:ipaddress/projectName/apps/services/preview/projectNameApp/common/0/default/projectNameApp.html"
Thanks.
See the answers here and the getting started module here.
This is not the URL of your all. This is the URL of the app PREVIEW. Moreover, this is preview of common environment. If you're targeting mobile/desktop web environment - add it to your project and then use WL console to generate short link. - Anton
If you are aiming to use the Mobile Web environment, meaning you take the public URL of the app from Worklight Console and place it in your mobile web site for users to access, there is the option to use bit.ly to shorten the URL; you will first need to create an account at http://bit.ly. - Idan Adar

IBM Worklight 6.0 - URL shortening

I have build a simple web app using Worklight.
My apps Preview URL is :
//local.loc:9080/Mobile/apps/services/preview/MobileAPP/common/0/default/MobileAPP.html
Shortend URL (with bit.ly credentials) is: http://bit.ly/153qbvr
Here the domain is completely different (bit.ly).
But actually I am looking for URL like : http://local.loc:9080/Mobile/MobileAPP.html.
Are there any ways to get a URL for public access like:
//:/application-name/launch_App_.html
if not, let me know ways to reduce the URL - if any.
The first URL you've mentioned is internal. It is meant for preview (development time mostly). Why would you be interested in shortening it? What is the value of doing so for you?
Also note that the shortened URL provided by bit.ly when using this service via Worklight - IS NOT the same URL as the first one (preview), it is meant for the Mobile Web environment, meaning for users who use their mobile browser app to access your app.
In short (no pun intended...), no, there is no way to do what you are asking for via Worklight - you cannot tweak the URL.
Let me re-iterate, the preview URL (the one mentioned in your question and that you want to shorten) is for the administrator or developer. It is NOT MEANT TO BE PUBLICALLY USED in any capacity, shape, form.
If you want to provide a web-public link to your app, add the Desktop Browser environment to your application. This environment is meant to access the app from a regular Desktop (PC/Mac) browser app. Note that even in this case, you cannot shorten the URL via a tweak in Worklight.
What you can do, is install some custom shortening service of your own in your company's servers and create your own custom URL that will look the way you want it to.

How to test file.watch on localhost?

I am displaying the contents of a folder in my AngularJS front-end (with Rails back-end). I want to watch the folder for any changes, such as new file, deleted file.
I obviously want to test the app on my localhost before deploying to a server, but I am not able to add localhost as an allowed domain in the apis console.
How can I set-up file.watch for testing?
Thanks
It's impossible to test push notifications without a verified domain, it's why we cant push confidential information to untrusted endpoints. I'd recommend you to buy/use a test domain/sub-domain for testing.
there's portly.co
worke's really nice , you can verify the domain with google site verification, and add it as a push domain.

Communication between a Mac app & local website/server

I want to control a mac app via a local website. I think the best way is to create a webserver with my mac app and then to send (primarily) integer values from the website and vice versa.
I found already CocoaHTTPServer, but I'm not sure how to do it.
For start with I want to have a slider on the website, that updates a slider in my mac application (and vice versa)
You will initiate on a separate thread or operation the web server and always wait for incoming requests. Whenever you receive a request you will handle it accordingly.
Also, if you are using this: https://github.com/robbiehanson/CocoaHTTPServer/
then there are a few examples that show how to do it. Copy the code from there to begin with the web server handling requests. After that, think through what you want to send and what you want to do. Build a form or something for the web site and submit a request to the web server.
CocoaHTTPServer will let you embed the web server into your application, which is a fine solution for what you're trying to accomplish.
Some thoughts on how to engineer it:
You'll need to subclass HTTPConnection.
Model your solution on the PostHTTPServer example.
You could get the data you want to send into the URL. Something like POST http://localhost:12345/updateSlider/123. (You probably don't need an actual POST, but no reason it wouldn't work. Technically a PUT would be more correct.)
Start by handling that part – where the browser sends a value to your application. To generate POST/PUT requests for testing purposes, use curl, or else build a static page and open it in your browser.
When you get that working, then worry about presenting a web page to the user.