how to embed mobile number with the url - objective-c

How can i embed a mobile number with the external link using objective c.
objective-c.
I have a link from my local server. This link will give some offers according to the users mobile number. I have hard coded the link with the mobile number. Now i wanted to get the mobile number in one variable and parse this variable along with the url which is coming from my local server.
The link which i hard coded will be like
http://123.1.241/eService/service.asmx/offers?mobilenumber=1234456789
Instead of giving the mobile number here itself, i wanted to store this number in one variable and use that variable in the link itself.

Depends really on the platform. On iOS for instance, you can craft a link like this:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel:1234456789"]];
That'll prompt the user to verify that they indeed want to call that number, opting to present them with the UIAlertView the system pops up, with a "Call" and "Cancel" button.

phone number url looks like this: tel:1-123-456-6789

Related

Opening a WhatsApp chat from a website in IOS & Android

Is it possible to open a chat with a given phone number in WhatsApp from an website on IOS & Android? If so, how?
Have you tried creating a link like so?
https://api.whatsapp.com/send?text=Check%20this%20out
The text parameter lets you pre-fill the chat box with some .. text : - )
As far as I know, you may also specify the recipient's number like so
https://api.whatsapp.com/send?phone=4917241077
Just make sure you add the country code properly (49 would be Germany in this case)
Of course, you may combine parameters. I gave this a quick test yesterday since I need it for a project of mine and accessing this link on desktop opens the WhatsApp web chat. Doing so on a mobile phone opens the app.
It seems like this is not possible from within websites. Time to rest my case.
Nowadays it is explained here on their website:
Use https://wa.me/{number} where the {number} is a full phone number in international format. Omit any brackets, dashes, plus signs, and leading zeros when adding the phone number in international format.

Confused with IOS Deep linking

I'll just want to ask if someone here know the step by step process of creating a deep link for an IOS app? I've tried to read some articles but it did not give me absolute answers. Thank you :)
Deep linking is basically just setting up url to your app so that other apps can launch it with information. The can launch to certain parts of the app if you set it up so that your app reacts to certain urls. So there are a few things that you have to do. For this example I will use two apps. If you are trying to integrate with an existing app you just have to find out what their url schemes are. So for this example I will use 'Messages' as one app and 'Schedule' as another.
First: in the 'Messages' app we will need to setup the schemes our Schedule app to call.
So open up your first app we need to add schemes so other apps can open it. Go to your info.plist click the little + and type URL types hit the triangle to expand and hit the + type URL Schemes and within that one add an item and put your apps name in it. Also add URL identifier along with $(PRODUCT_BUNDLE_IDENTIFIER) as the value. `
Then we just have to add the apps that we can open so hit the top level + again and add LSApplicationQueriesSchemes This whitlists the apps so we can evaluate weather or not they are installed on the device.
Now we can jump over to the other app and create a way to call this. For this example lets make it happen when we press a button.
IBAction launchMessagesApp() {
let url = NSURL(string: "Messages://") where UIApplication.sharedApplication().canOpenURL(url) {
self.launchAppWithURL(url, name: "Messages")
}
The canOpenURL(url) checks to see if the application is on the device. If you wanted to you could launch the app store to your app if that retuned false. then launchAppWithURL actually launches it. That is the basic setup you may also want to have multiple things happen so you may have multiple url schemes that launch the same app but take it to different parts of the app. In the app delegate of the app in the function
func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool {
print(url)
//Any customizations for the app here
}
You can do anything you can imagine.
Have you checked out Turnpike? It's an open source tool for enabling deep linking in iOS apps. http://urxtech.github.io/#GettingStarted
If you want to create a deeplink you might need to do some server code to detect the user device/browser and do some actions based on this.
I've created a tool that simplify this process, you can check it here:
http://www.uppurl.com/
It's mainly a short link tool that checks for user device and give him the right url based on his devices. With this tool you don't need to write any server code and it also takes care of different devices, operating systems and browsers.

Custom sounds for local notification in iphone, but using the build in sounds

I am setting up a local notification and I am using:
// other code to setup myNotifyAlarm (omitted)
myNotifyAlarm.soundName = #"Glass.aiff";
[app scheduleLocalNotification:myNotifyAlarm];
(code found in many sites as an example on how to set a local notif.)
But I get the sound set in the Settings->Sounds->Text-Tone not Glass.aiff.
I tried to replace the #"Glass.aiff" with the .caf sounds (from http://iphonedevwiki.net/index.php/AudioServices), no luck there either.
I don't want to include "my own" sounds, the iPhone (and other iDevices) have a lot of build in sounds that I could use. The question is how?
(I want to give the user an option to choose a different sound for each notification alert (my app has 4 "types"), so I need a way to change the sound... something like a personalized ring-tone for notifications)

How to simulate a click in a webpage in iOS with objective-C

I'm looking for an equivalent of Mechanize (Ruby/python and more) for iOS.
I need to simulate a click in a webpage (form submission) and get the response back. I tried to construct a POST-request using ASIHTTPRequest without succes. I was able to create a solution in Ruby (with Mechanize) but I want to be able to do the same in objective-c for iphone development. Any suggestions ?
As described in the duplicated posts, the API to programmatically simulate touches is private, so not appropriate for a shipping app. Follow the links if you want to know how to do it anyway.

Sent text to notes

I'm trying to add a 'copy to notes' button in my app which sends a text to the notes app of ios. Is there any possible way to integrate this?
I've done some research and didn't find anything and since I've never seen it in an other app I guess it's not possible, but I thought It was worth a question.
Good question. Situations like the one you describe are always handled with URL schemes using the UIApplication method openURL:. For example, to launch the phone app with a specific number you could do:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel:1-234-567-8910"];
Or to launch the Mail app:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"mailto:nobody#example.com"];
Just to show a few examples. The Apple URL Scheme Reference document describes all of the various URL schemes to integrate with different system apps. Nowhere in this document does it mention a URL scheme for the built in Notes app. If it were possible to send text to the Notes app, I would expect the document to advertise the fact. While it's not conclusive proof that it's not possible, I still think it should be cited as strong evidence of such.
Note that there are likely several third party note-taking apps that have their own custom URL scheme that may support launching with text.