|
7 | 7 | <!--<Button @tap="onTapScheduleNotification" class="btn" text="Schedule Notification"></Button>--> |
8 | 8 | <!--<Button @tap="onTapCancelAll" class="btn" text="Cancel notifications"></Button>--> |
9 | 9 | <Label class="message" :text="message" textWrap="true"></Label> |
| 10 | + <MLKitTextRecognition width="260" |
| 11 | + height="340" |
| 12 | + processEveryNthFrame="5" |
| 13 | + @scanResult="onTextRecognitionResult"> |
| 14 | + </MLKitTextRecognition> |
| 15 | + |
10 | 16 | </StackLayout> |
11 | 17 | </Page> |
12 | 18 | </template> |
13 | 19 |
|
14 | 20 | <script> |
15 | | - const firebase = require("nativescript-plugin-firebase"); |
| 21 | + const firebase = require("nativescript-plugin-firebase"); |
16 | 22 |
|
17 | | - firebase.init({ |
18 | | - onDynamicLinkCallback: function (result) { |
19 | | - console.log("Dynamic Link received: " + result); |
20 | | - console.log("Dynamic Link received, url: " + result.url); |
21 | | - if (result.url.indexOf("/campaigns/shit") > -1) { |
22 | | - // note that you could deeplink/route the user now, but let's just show an alert |
23 | | - alert({ |
24 | | - title: "Campaign button tapped!", |
25 | | - message: "You tapped the button in the 'Firebase is the 💩' campaign - well don!", |
26 | | - okButtonText: "Yep!" |
27 | | - }) |
28 | | - } |
| 23 | + firebase.init({ |
| 24 | + onDynamicLinkCallback: function (result) { |
| 25 | + console.log("Dynamic Link received: " + result); |
| 26 | + console.log("Dynamic Link received, url: " + result.url); |
| 27 | + if (result.url.indexOf("/campaigns/shit") > -1) { |
| 28 | + // note that you could deeplink/route the user now, but let's just show an alert |
| 29 | + alert({ |
| 30 | + title: "Campaign button tapped!", |
| 31 | + message: "You tapped the button in the 'Firebase is the 💩' campaign - well don!", |
| 32 | + okButtonText: "Yep!" |
| 33 | + }) |
29 | 34 | } |
30 | | - }).then(function () { |
31 | | - console.log("Firebase initialized"); |
32 | | - }).catch(function (error) { |
33 | | - console.log("Error initializing Firebase: " + error); |
34 | | - }); |
| 35 | + } |
| 36 | + }).then(function () { |
| 37 | + console.log("Firebase initialized"); |
| 38 | + }).catch(function (error) { |
| 39 | + console.log("Error initializing Firebase: " + error); |
| 40 | + }); |
35 | 41 |
|
36 | 42 | export default { |
37 | 43 | data() { |
|
41 | 47 | }, |
42 | 48 |
|
43 | 49 | methods: { |
| 50 | + onTextRecognitionResult() { |
| 51 | + console.log("onTextRecognitionResult"); |
| 52 | + } |
44 | 53 | /* |
45 | 54 | onTapHasPermission() { |
46 | 55 | LocalNotifications.hasPermission() |
|
0 commit comments