Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
Callmycab-Driverapp
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kevin
Callmycab-Driverapp
Commits
3980622b
Commit
3980622b
authored
Jul 09, 2018
by
Alen Jose
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'alen' into 'master'
july 6 See merge request alen/CMC-driver!10
parents
9e1168bd
bfdc8e80
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
17 deletions
+26
-17
app.component.ts
src/app/app.component.ts
+24
-15
signin.ts
src/pages/signin/signin.ts
+2
-2
No files found.
src/app/app.component.ts
View file @
3980622b
...
...
@@ -10,6 +10,7 @@ import { Myservice } from "../providers/myservice";
import
{
driver
}
from
"../models/mymodel"
;
import
*
as
firebase
from
'firebase'
;
import
{
LocalNotifications
}
from
'@ionic-native/local-notifications'
;
import
{
dataService
}
from
"../providers/common.service"
;
@
Component
({
templateUrl
:
'app.html'
...
...
@@ -25,7 +26,7 @@ export class MyApp {
status
:
boolean
pushId
:
string
constructor
(
public
platform
:
Platform
,
public
statusBar
:
StatusBar
,
public
splashScreen
:
SplashScreen
,
private
network
:
Network
,
private
alertCtrl
:
AlertController
,
private
oneSignal
:
OneSignal
,
private
locationAccuracy
:
LocationAccuracy
,
private
storage
:
Storage
,
private
myservice
:
Myservice
,
public
events
:
Events
,
private
localNotifications
:
LocalNotifications
)
{
constructor
(
public
platform
:
Platform
,
public
statusBar
:
StatusBar
,
public
splashScreen
:
SplashScreen
,
private
network
:
Network
,
private
alertCtrl
:
AlertController
,
private
oneSignal
:
OneSignal
,
private
locationAccuracy
:
LocationAccuracy
,
private
storage
:
Storage
,
private
myservice
:
Myservice
,
public
events
:
Events
,
private
localNotifications
:
LocalNotifications
,
private
data
:
dataService
)
{
// , private localNotifications: LocalNotifications
this
.
initializeApp
();
...
...
@@ -162,31 +163,39 @@ export class MyApp {
this
.
myservice
.
load_post
({
id
:
this
.
local
.
id
},
'getMyRides'
).
subscribe
(
response
=>
{
if
(
response
.
status
==
'success'
)
{
// console.log(response.data.upcoming)
var
upcoming
=
response
.
data
.
upcoming
var
arr
=
[]
for
(
let
i
=
0
;
i
<
upcoming
.
length
;
i
++
)
{
this
.
localNotifications
.
schedule
([{
arr
.
push
({
id
:
i
,
text
:
'Ride Notification'
,
title
:
'CMC-Driver'
,
trigger
:
{
at
:
new
Date
(
upcoming
[
i
].
pickup_date
+
upcoming
[
i
].
pickup_time
)
},
trigger
:
{
at
:
new
Date
(
upcoming
[
i
].
pickup_date
+
' '
+
upcoming
[
i
].
pickup_time
)
},
led
:
'FF0000'
,
sound
:
null
sound
:
null
,
data
:
upcoming
[
i
],
vibrate
:
true
,
})
if
(
i
==
upcoming
.
length
-
1
){
this
.
localNotifications
.
schedule
(
arr
);
var
This
=
this
setTimeout
(()
=>
{
This
.
localNotifications
.
getAll
().
then
(
data
=>
{
console
.
log
(
'1'
,
data
)
})
},
5000
);
}
]);
// if(i == upcoming.length-1){
var
This
=
this
setTimeout
(()
=>
{
This
.
localNotifications
.
getAll
().
then
(
data
=>
{
console
.
log
(
'1'
,
data
)
})
},
5000
);
// }
}
}
})
this
.
localNotifications
.
on
(
'click'
).
subscribe
(
rideData
=>
{
console
.
log
(
rideData
)
this
.
data
.
setrideData
(
rideData
.
data
)
this
.
nav
.
push
(
'RidedetailsPage'
)
})
}
}
src/pages/signin/signin.ts
View file @
3980622b
...
...
@@ -43,8 +43,8 @@ export class SigninPage {
},
500
);
}
else
{
T
his
.
myservice
.
hide_loader
();
T
his
.
myservice
.
show_alert
(
''
,
response
.
message
)
t
his
.
myservice
.
hide_loader
();
t
his
.
myservice
.
show_alert
(
''
,
response
.
message
)
}
})
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment