-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ok for first step guide from https://developer.ayoba.me/documentation…
- Loading branch information
Showing
3 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# charge | ||
charge | ||
This ia a charge Microapp for ayoba | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<html> | ||
<head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<style> | ||
img { | ||
display: block; | ||
margin-left: auto; | ||
margin-right: auto; | ||
} | ||
</style> | ||
</head> | ||
<body style="background-color:#1565c0;"> | ||
<script src="../lib/microapp.js"></script> | ||
<script>sayHello()</script> | ||
<img src="logo.png" style="width:72px;"/> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
var Ayoba = getAyoba() | ||
|
||
/** | ||
* Determine the mobile operating system and returns the | ||
* proper javascript interface | ||
*/ | ||
function getAyoba() { | ||
var userAgent = navigator.userAgent || navigator.vendor || window.opera; | ||
|
||
// Windows Phone must come first because its UA also contains "Android" | ||
if (/windows phone/i.test(userAgent)) { | ||
return null; | ||
} | ||
|
||
if (/android/i.test(userAgent)) { | ||
return Android; | ||
} | ||
|
||
// iOS detection from: http://stackoverflow.com/a/9039885/177710 | ||
if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) { | ||
return null; // todo | ||
} | ||
|
||
return "unknown"; | ||
} |