Skip to content

Commit

Permalink
Fix request permission calls (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-kuznetsov-hypertrack authored Oct 9, 2023
1 parent 5755e14 commit cf8db4a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions app/src/main/assets/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<body>
<h1>Quickstart Webview</h1>
<h1>Quickstart WebView</h1>
<h4>Device ID:</h4>
<p id="device-id"></p>
<script src="main.js"></script>
Expand All @@ -23,12 +23,12 @@ <h4>Device ID:</h4>
<button onclick="setName()">Set name</button>
<br/><br/>

<button onclick="askForLocationPermission()">Ask for location permission</button>
<button onclick="requestLocationPermission()">Request location permission</button>
<br/><br/>
<button onclick="askForBackgroundLocationPermission()">Ask for background location permission
<button onclick="requestBackgroundLocationPermission()">Request background location permission
</button>
<br/><br/>
<button onclick="askForNotificationsPermission()">Ask for notifications permission</button>
<button onclick="requestNotificationsPermission()">Request notifications permission</button>
<br/><br/>
<button onclick="openAppSettings()">Open app settings</button>
</body>
Expand Down
16 changes: 8 additions & 8 deletions app/src/main/assets/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,33 +103,33 @@ function setName() {
}
}

function askForLocationPermission() {
function openAppSettings() {
try {
HyperTrack.askForLocationPermission();
HyperTrack.openAppSettings();
} catch (e) {
alert(e);
}
}

function askForBackgroundLocationPermission() {
function requestLocationPermission() {
try {
HyperTrack.askForBackgroundLocationPermission();
HyperTrack.requestLocationPermission();
} catch (e) {
alert(e);
}
}

function askForNotificationsPermission() {
function requestBackgroundLocationPermission() {
try {
HyperTrack.askForNotificationsPermission();
HyperTrack.requestBackgroundLocationPermission();
} catch (e) {
alert(e);
}
}

function openAppSettings() {
function requestNotificationsPermission() {
try {
HyperTrack.openAppSettings();
HyperTrack.requestNotificationsPermission();
} catch (e) {
alert(e);
}
Expand Down

0 comments on commit cf8db4a

Please sign in to comment.