Salesforce

Accessing the Capabilities of Mobile Devices (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

Accessing the Capabilities of Mobile Devices (Magic xpa 3.x)

You can use the device capabilities such as calling a phone number, sending an SMS, and opening a browser, by using the Invoke OS command with the URL of the required command. For example:

  • tel:1-408-555-5555

  • sms:1-408-555-1212

  • mailto:support@magicsoftware.com

  • mailto:?to=support@magicsoftware.com&subject=this is a test&body= test mail

  • http://magicsoftware.com

Refer also to:

http://developer.apple.com/library/safari/#featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007891-SW1

Note: When sending mail, there are some characters that are not allowed in the subject and body. On iOS for example, the ampersand (&) character should be replaced with %26 and on Android the following characters should be removed: #,%,&, :, and =.

You can also use the convention described above to call 3rd party applications, which can be accessed via the URL format. For example, you can use:

  • 'waze://?q=New York' to open the Waze GPS application and navigate to New York.

  • 'geo:59.915494,30.409456' to open a navigation app, such as Google Maps or Waze, on the 59.915494 latitude and 30.409456 longitude.

Printing a PDF

On iOS devices:

Printing a PDF can be done via the Invoke OS command with the command of Print:filename where filename is either:

  • A path to a local file (as received from the ServerFileToClient() function)

  • A URL to a file on a web server (such as 'http://1.1.1.1/myfile.pdf')

The printing will be done using the iOS Air Print protocol.

Since version: 2.3

On Android devices:

Printing a PDF can be done via the Invoke OS command with the command of Print:filename where filename is:

  • A path to a local file (as received from the ServerFileToClient function)

The printing will be done using the Google Cloud Print protocol.

Since version: 3.0

Viewing a PDF

On iOS devices:

You can view a PDF using Magic xpa's internal Browser control.

Note that the PDF should be located on the server and not locally on the device.

On Android devices:

Most of the Android browsers do not display PDFs. Therefore, you cannot use Magic xpa's internal Browser control to view a PDF.

However, you can view a PDF using a third-party PDF viewer application. You do this by using the Invoke OS command with the command of pdf:filename where filename is a path to a local file that is stored on a public folder on the device, such as the /SDCARD folder.

For example, the following commands will copy the ReleaseNotes.pdf file from the C:\Magic\ folder on the server to the /SDCAD folder on the client and will open a PDF viewer to show this file:

  1. Evaluate ClientFileCopy(ServerFileToClient('C:\Magic\ReleaseNotes.pdf'),'/sdcard/tmpfile.pdf')

  2. Invoke OS 'pdf:/sdcard/tmpfile.pdf' (where the Execute On property is set to Client)

Since version: 2.4

Reference
Attachment 
Attachment