Slide 1

Slide 1 text

URL Schemes Jason Kneen Saturday, 29 June 13

Slide 2

Slide 2 text

URL Schemes Jason Kneen Saturday, 29 June 13

Slide 3

Slide 3 text

"CPVUNF http://twitter/jasonkneen http://github.com/jasonkneen http://jasonified.com http://bouncingfish.com App Developer, Titanium “Titan” Saturday, 29 June 13

Slide 4

Slide 4 text

What is a URL Scheme? or "URI Schemes" if you like Saturday, 29 June 13

Slide 5

Slide 5 text

What is a URL Scheme? "Top level of the uniform resource locator naming structure" or "URI Schemes" if you like Saturday, 29 June 13

Slide 6

Slide 6 text

What is a URL Scheme? "Top level of the uniform resource locator naming structure" or "URI Schemes" if you like Saturday, 29 June 13

Slide 7

Slide 7 text

• https:// What is a URL Scheme? "Top level of the uniform resource locator naming structure" or "URI Schemes" if you like Saturday, 29 June 13

Slide 8

Slide 8 text

• https:// • ftp:// What is a URL Scheme? "Top level of the uniform resource locator naming structure" or "URI Schemes" if you like Saturday, 29 June 13

Slide 9

Slide 9 text

• https:// • ftp:// • mailto: What is a URL Scheme? "Top level of the uniform resource locator naming structure" or "URI Schemes" if you like Saturday, 29 June 13

Slide 10

Slide 10 text

• https:// • ftp:// • mailto: • tel: What is a URL Scheme? "Top level of the uniform resource locator naming structure" or "URI Schemes" if you like Saturday, 29 June 13

Slide 11

Slide 11 text

• https:// • ftp:// • mailto: • tel: • outlook:// What is a URL Scheme? "Top level of the uniform resource locator naming structure" or "URI Schemes" if you like Saturday, 29 June 13

Slide 12

Slide 12 text

What can we do with them? The same thing we do every night, Pinky - try to take over the URL! Saturday, 29 June 13

Slide 13

Slide 13 text

What can we do with them? • Detect Apps The same thing we do every night, Pinky - try to take over the URL! Saturday, 29 June 13

Slide 14

Slide 14 text

What can we do with them? • Detect Apps • Launch / Resume Apps The same thing we do every night, Pinky - try to take over the URL! Saturday, 29 June 13

Slide 15

Slide 15 text

What can we do with them? • Detect Apps • Launch / Resume Apps • Send commands/data to apps The same thing we do every night, Pinky - try to take over the URL! Saturday, 29 June 13

Slide 16

Slide 16 text

What can we do with them? • Detect Apps • Launch / Resume Apps • Send commands/data to apps • Receive data/callbacks from apps The same thing we do every night, Pinky - try to take over the URL! Saturday, 29 June 13

Slide 17

Slide 17 text

Examples Saturday, 29 June 13

Slide 18

Slide 18 text

Launch Center Saturday, 29 June 13

Slide 19

Slide 19 text

Launch Center apps How it works Saturday, 29 June 13

Slide 20

Slide 20 text

Launch Center apps How it works • App detection via URL Schemes Saturday, 29 June 13

Slide 21

Slide 21 text

Launch Center apps How it works • App detection via URL Schemes • Ability to add “Actions” Saturday, 29 June 13

Slide 22

Slide 22 text

Launch Center apps How it works • App detection via URL Schemes • Ability to add “Actions” • Dependent on URL Scheme list Saturday, 29 June 13

Slide 23

Slide 23 text

Launch Center apps Apps and Actions Saturday, 29 June 13

Slide 24

Slide 24 text

Launch Center apps Apps and Actions Saturday, 29 June 13

Slide 25

Slide 25 text

iTunes / AppStore Saturday, 29 June 13

Slide 26

Slide 26 text

AppStore / iTunes Launching the native app from search results Saturday, 29 June 13

Slide 27

Slide 27 text

AppStore / iTunes Launching the native app from search results Saturday, 29 June 13

Slide 28

Slide 28 text

AppStore / iTunes Launching the native app from search results Saturday, 29 June 13

Slide 29

Slide 29 text

Google Maps Saturday, 29 June 13

Slide 30

Slide 30 text

Google Maps Launching the native app for map links Saturday, 29 June 13

Slide 31

Slide 31 text

Google Maps Launching the native app for map links Web App Saturday, 29 June 13

Slide 32

Slide 32 text

Google Maps Launching the native app for map links Web App Saturday, 29 June 13

Slide 33

Slide 33 text

Google Maps Launching the native app for map links Web App Native App Saturday, 29 June 13

Slide 34

Slide 34 text

YouTube Saturday, 29 June 13

Slide 35

Slide 35 text

YouTube Launching YouTube videos in the native app Saturday, 29 June 13

Slide 36

Slide 36 text

YouTube Launching YouTube videos in the native app Google Search Saturday, 29 June 13

Slide 37

Slide 37 text

YouTube Launching YouTube videos in the native app Google Search Native App Saturday, 29 June 13

Slide 38

Slide 38 text

Gmail Saturday, 29 June 13

Slide 39

Slide 39 text

Examples iOS Gmail app, detecting other Google app installs Saturday, 29 June 13

Slide 40

Slide 40 text

Examples iOS Gmail app, detecting other Google app installs Before Google Maps installation Saturday, 29 June 13

Slide 41

Slide 41 text

Examples iOS Gmail app, detecting other Google app installs Before Google Maps installation After Google Maps installation Saturday, 29 June 13

Slide 42

Slide 42 text

Examples Gmail opening Chrome Saturday, 29 June 13

Slide 43

Slide 43 text

Examples Gmail opening Chrome App Switch Saturday, 29 June 13

Slide 44

Slide 44 text

Apps using URL Schemes • youtube:// • tweetbot:// • googlemaps:// • twitter:// • bufferapp:// • linkedin:// • pinterest:// • googlegmail:// Enter into the browser to test • http://wiki.akosma.com/IPhone_URL_Schemes Useful links • http://canhandleUrl.com Saturday, 29 June 13

Slide 45

Slide 45 text

Launching apps with actions Controlling Tweetbot on iOS Saturday, 29 June 13

Slide 46

Slide 46 text

Launching apps with actions • tweetbot:///post?text=&callback_url= • tweetbot:///search?query=&callback_url= • tweetbot:///user_profile/?callback_url= Controlling Tweetbot on iOS Saturday, 29 June 13

Slide 47

Slide 47 text

Launching apps with actions • tweetbot:///post?text=&callback_url= • tweetbot:///search?query=&callback_url= • tweetbot:///user_profile/?callback_url= Controlling Tweetbot on iOS tweetbot://jasonkneen/post?text=Hello! Saturday, 29 June 13

Slide 48

Slide 48 text

Launching apps with actions Try it out without code tweetbot://something/post?text=Hello! http://tinyurl.com/ticonfurl http://handleopenurl.com/scheme/tweetbot Saturday, 29 June 13

Slide 49

Slide 49 text

Launching apps with actions Try it out without code tweetbot://something/post?text=Hello! http://tinyurl.com/ticonfurl http://handleopenurl.com/scheme/tweetbot Saturday, 29 June 13

Slide 50

Slide 50 text

URL Scheme usages Saturday, 29 June 13

Slide 51

Slide 51 text

URL Scheme usages • App launching (Chrome, Maps, YouTube) Saturday, 29 June 13

Slide 52

Slide 52 text

URL Scheme usages • App launching (Chrome, Maps, YouTube) • Cross-promote apps Saturday, 29 June 13

Slide 53

Slide 53 text

URL Scheme usages • App launching (Chrome, Maps, YouTube) • Cross-promote apps • Single Sign On Saturday, 29 June 13

Slide 54

Slide 54 text

URL Scheme usages • App launching (Chrome, Maps, YouTube) • Cross-promote apps • Single Sign On • SMS based Push Notifications Saturday, 29 June 13

Slide 55

Slide 55 text

URL Scheme usages • App launching (Chrome, Maps, YouTube) • Cross-promote apps • Single Sign On • SMS based Push Notifications • Use specific features of other apps Saturday, 29 June 13

Slide 56

Slide 56 text

Single sign-on apps Saturday, 29 June 13

Slide 57

Slide 57 text

Single sign-on apps Launch SSO Saturday, 29 June 13

Slide 58

Slide 58 text

Single sign-on apps Launch SSO Saturday, 29 June 13

Slide 59

Slide 59 text

Single sign-on apps Launch SSO Login Saturday, 29 June 13

Slide 60

Slide 60 text

Single sign-on apps Launch SSO Login Saturday, 29 June 13

Slide 61

Slide 61 text

Single sign-on apps Launch SSO Login Find related Apps Saturday, 29 June 13

Slide 62

Slide 62 text

Single sign-on apps Launch SSO Login Find related Apps Saturday, 29 June 13

Slide 63

Slide 63 text

Single sign-on apps Launch SSO Login Find related Apps Prompt to install Saturday, 29 June 13

Slide 64

Slide 64 text

Single sign-on apps Saturday, 29 June 13

Slide 65

Slide 65 text

Single sign-on apps Launch sub app Saturday, 29 June 13

Slide 66

Slide 66 text

Single sign-on apps Launch sub app Saturday, 29 June 13

Slide 67

Slide 67 text

Single sign-on apps Launch sub app SSO exists? Saturday, 29 June 13

Slide 68

Slide 68 text

Single sign-on apps Launch sub app SSO exists? Saturday, 29 June 13

Slide 69

Slide 69 text

Single sign-on apps Launch sub app SSO exists? Yes Saturday, 29 June 13

Slide 70

Slide 70 text

Single sign-on apps Launch sub app SSO exists? Launch SSO Yes Saturday, 29 June 13

Slide 71

Slide 71 text

Single sign-on apps Launch sub app SSO exists? Launch SSO Yes Saturday, 29 June 13

Slide 72

Slide 72 text

Single sign-on apps Launch sub app SSO exists? Launch SSO Auth Yes Saturday, 29 June 13

Slide 73

Slide 73 text

Single sign-on apps Launch sub app SSO exists? Launch SSO Auth Yes Saturday, 29 June 13

Slide 74

Slide 74 text

Single sign-on apps Launch sub app SSO exists? Launch SSO Auth Yes Saturday, 29 June 13

Slide 75

Slide 75 text

Push notifications with SMS Saturday, 29 June 13

Slide 76

Slide 76 text

Push notifications with SMS Saturday, 29 June 13

Slide 77

Slide 77 text

Push notifications with SMS SMS Arrives Saturday, 29 June 13

Slide 78

Slide 78 text

Push notifications with SMS SMS Arrives Saturday, 29 June 13

Slide 79

Slide 79 text

Push notifications with SMS SMS Arrives Click URL Saturday, 29 June 13

Slide 80

Slide 80 text

Push notifications with SMS SMS Arrives Click URL Saturday, 29 June 13

Slide 81

Slide 81 text

Push notifications with SMS SMS Arrives Click URL Launch App Saturday, 29 June 13

Slide 82

Slide 82 text

Push notifications with SMS SMS Arrives Click URL Launch App Saturday, 29 June 13

Slide 83

Slide 83 text

Push notifications with SMS SMS Arrives Click URL Launch App Process URL Saturday, 29 June 13

Slide 84

Slide 84 text

Sending binary data between apps Saturday, 29 June 13

Slide 85

Slide 85 text

Sharing data between apps Transferring binary files Saturday, 29 June 13

Slide 86

Slide 86 text

Sharing data between apps • Encode the file into base64 Transferring binary files Saturday, 29 June 13

Slide 87

Slide 87 text

Sharing data between apps • Encode the file into base64 • Transfer it via URL Transferring binary files Saturday, 29 June 13

Slide 88

Slide 88 text

Sharing data between apps • Encode the file into base64 • Transfer it via URL • URL Decode on the other side Transferring binary files Saturday, 29 June 13

Slide 89

Slide 89 text

Sharing data between apps • Encode the file into base64 • Transfer it via URL • URL Decode on the other side • Decode from base64 Transferring binary files Saturday, 29 June 13

Slide 90

Slide 90 text

Sharing data between apps • Encode the file into base64 • Transfer it via URL • URL Decode on the other side • Decode from base64 • Do Stuff Transferring binary files Saturday, 29 June 13

Slide 91

Slide 91 text

Demo Saturday, 29 June 13

Slide 92

Slide 92 text

Implementing URL Schemes Adding to Titanium Apps Saturday, 29 June 13

Slide 93

Slide 93 text

Implementing URL Schemes Adding to Titanium Apps • Register a URL Scheme for an App Saturday, 29 June 13

Slide 94

Slide 94 text

Implementing URL Schemes Adding to Titanium Apps • Register a URL Scheme for an App • Add events and handling code to read url Saturday, 29 June 13

Slide 95

Slide 95 text

Implementing URL Schemes Adding to Titanium Apps • Register a URL Scheme for an App • Add events and handling code to read url • Add code to parse URLs Saturday, 29 June 13

Slide 96

Slide 96 text

Implementing URL Schemes Adding to Titanium Apps • Register a URL Scheme for an App • Add events and handling code to read url • Add code to parse URLs • Add actions, responses, callbacks Saturday, 29 June 13

Slide 97

Slide 97 text

Implementing URL Schemes Adding to Titanium Apps • Register a URL Scheme for an App • Add events and handling code to read url • Add code to parse URLs • Add actions, responses, callbacks • Let people know about it (if public) Saturday, 29 June 13

Slide 98

Slide 98 text

Where to publish? http://wiki.akosma.com/IPhone_URL_Schemes http://handleopenurl.com http://applookup.com Saturday, 29 June 13

Slide 99

Slide 99 text

Where to publish? Saturday, 29 June 13

Slide 100

Slide 100 text

Detecting and launching apps on iOS                          if  (Ti.Platform.canOpenUrl(“tweetbot://”);{           //  do  stuff Ti.Platform.openUrl(“tweetbot://default/post? text=Hello!”);                } Saturday, 29 June 13

Slide 101

Slide 101 text

Detecting and launching apps on Android var  myIntent  =  Ti.Android.createIntent({                            action:  Ti.Android.ACTION_MAIN,                            packageName:  "com.mybundle.appname",                            className:  "com.mybundle.appname.appname",                            flags:  Ti.Android.FLAG_ACTIVITY_NEW_TASK, }); myIntent.addCategory(Ti.Android.CATEGORY_LAUNCHER); Ti.Android.currentActivity.startActivity(  myIntent  ); Saturday, 29 June 13

Slide 102

Slide 102 text

Register a URL Scheme for an App In iOS using info.plist Saturday, 29 June 13

Slide 103

Slide 103 text

Register a URL Scheme for an App In Android TiApp.xml :- Saturday, 29 June 13

Slide 104

Slide 104 text

Register a URL Scheme for an App In Android TiApp.xml :- Saturday, 29 June 13

Slide 105

Slide 105 text

Register a URL Scheme for an App In both iOS and Android within TiApp.xml Saturday, 29 June 13

Slide 106

Slide 106 text

Add handling code to parse URLs In iOS, trap app start and resume events                          if  (Ti.App.getArguments().url)  {                                  urlToObject(Ti.App.getArguments().url);                } http://tinyurl.com/urlschemecode Saturday, 29 June 13

Slide 107

Slide 107 text

Add handling code to parse URLs In Android var  activity  =  Ti.Android.currentActivity; var  data  =  activity.getIntent().getData();                                if  (data)  {                    urlToObject(data);                } http://tinyurl.com/urlschemecode Saturday, 29 June 13

Slide 108

Slide 108 text

Parsing the URLs In Android and iOS function  urlToObject(url)  { var  returnObj  =  {}; url  =  url.replace('URLSCHEME://?',  ''); var  params  =  url.split('&'); params.forEach(function(param)  {                                 var  keyAndValue  =  param.split('='); returnObj[keyAndValue[0]]  =  decodeURI(keyAndValue[1]); }); return  obj; } http://tinyurl.com/urlschemecode Saturday, 29 June 13

Slide 109

Slide 109 text

URL Scheme compatibility issues Saturday, 29 June 13

Slide 110

Slide 110 text

URL Scheme compatibility issues • URL Schemes on non-mobile devices Saturday, 29 June 13

Slide 111

Slide 111 text

URL Scheme compatibility issues • URL Schemes on non-mobile devices • Not recognized by some apps / services Saturday, 29 June 13

Slide 112

Slide 112 text

URL Scheme compatibility issues • URL Schemes on non-mobile devices • Not recognized by some apps / services • Use a redirect script Saturday, 29 June 13

Slide 113

Slide 113 text

Using a redirect script Saturday, 29 June 13

Slide 114

Slide 114 text

Using a redirect script • Allows you to detect apps, act accordingly Saturday, 29 June 13

Slide 115

Slide 115 text

Using a redirect script • Allows you to detect apps, act accordingly • You can use services that don’t accept URL schemes Saturday, 29 June 13

Slide 116

Slide 116 text

Using a redirect script • Allows you to detect apps, act accordingly • You can use services that don’t accept URL schemes • Allows checking, fallback URLs Saturday, 29 June 13

Slide 117

Slide 117 text

Using a redirect script Saturday, 29 June 13

Slide 118

Slide 118 text

Using a redirect script http://www.foo.com/redirect.html? action=post&data=Hello Saturday, 29 June 13

Slide 119

Slide 119 text

Using a redirect script http://www.foo.com/redirect.html? action=post&data=Hello Saturday, 29 June 13

Slide 120

Slide 120 text

Using a redirect script http://www.foo.com/redirect.html? action=post&data=Hello redirect.html Saturday, 29 June 13

Slide 121

Slide 121 text

Using a redirect script http://www.foo.com/redirect.html? action=post&data=Hello redirect.html Saturday, 29 June 13

Slide 122

Slide 122 text

Using a redirect script http://www.foo.com/redirect.html? action=post&data=Hello redirect.html Check for App Saturday, 29 June 13

Slide 123

Slide 123 text

Using a redirect script http://www.foo.com/redirect.html? action=post&data=Hello redirect.html Check for App Saturday, 29 June 13

Slide 124

Slide 124 text

Using a redirect script http://www.foo.com/redirect.html? action=post&data=Hello redirect.html Check for App Saturday, 29 June 13

Slide 125

Slide 125 text

Using a redirect script http://www.foo.com/redirect.html? action=post&data=Hello redirect.html Check for App Fallback Saturday, 29 June 13

Slide 126

Slide 126 text

Using a redirect script http://www.foo.com/redirect.html? action=post&data=Hello redirect.html Check for App Launch App Fallback Saturday, 29 June 13

Slide 127

Slide 127 text

Creating a redirect script Saturday, 29 June 13

Slide 128

Slide 128 text

Creating a redirect script Saturday, 29 June 13

Slide 129

Slide 129 text

Summary Saturday, 29 June 13

Slide 130

Slide 130 text

Summary • Direct cross-platform, inter-app communication Saturday, 29 June 13

Slide 131

Slide 131 text

Summary • Direct cross-platform, inter-app communication • Growing support from developers Saturday, 29 June 13

Slide 132

Slide 132 text

Summary • Direct cross-platform, inter-app communication • Growing support from developers • Resources available to find out Schemes / Actions Saturday, 29 June 13

Slide 133

Slide 133 text

Summary • Direct cross-platform, inter-app communication • Growing support from developers • Resources available to find out Schemes / Actions • Shorten, handle failures, desktop access Saturday, 29 June 13

Slide 134

Slide 134 text

Summary • Direct cross-platform, inter-app communication • Growing support from developers • Resources available to find out Schemes / Actions • Shorten, handle failures, desktop access • You can send more than text! Saturday, 29 June 13

Slide 135

Slide 135 text

Thank you! Saturday, 29 June 13