Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cordova-plugin-local-notifications
Overview
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
Nabil Sadki
cordova-plugin-local-notifications
Commits
c02c926a
Commit
c02c926a
authored
Oct 03, 2014
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix iOS7 crash (#280)
parent
fa87fdc5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
+18
-13
APPLocalNotification.m
src/ios/APPLocalNotification.m
+18
-13
No files found.
src/ios/APPLocalNotification.m
View file @
c02c926a
...
...
@@ -20,6 +20,7 @@
*/
#import "APPLocalNotification.h"
#import <Cordova/CDVAvailability.h>
@interface
APPLocalNotification
(
Private
)
...
...
@@ -108,8 +109,8 @@
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
0
.
3
*
NSEC_PER_SEC
),
dispatch_get_main_queue
(),
^
{
[
self
cancelNotification
:
notification
fireEvent
:
NO
];
});
[
self
cancelNotification
:
notification
fireEvent
:
NO
];
});
}
[
self
scheduleNotificationWithProperties
:
properties
];
...
...
@@ -238,12 +239,14 @@
*/
-
(
void
)
promptForPermission
:(
CDVInvokedUrlCommand
*
)
command
{
if
(
[[[
UIDevice
currentDevice
]
systemVersion
]
floatValue
]
>=
8
.
0
)
{
UIUserNotificationType
types
=
UIUserNotification
TypeAlert
|
UIUserNotificationTypeBadge
|
UIUserNotificationTypeSound
;
if
(
IsAtLeastiOSVersion
(
@"8.0"
)
)
{
UIUserNotificationType
types
;
UIUserNotification
Settings
*
settings
;
UIUserNotificationSettings
*
settings
=
[
UIUserNotificationSettings
settingsForTypes
:
types
categories
:
nil
];
types
=
UIUserNotificationTypeAlert
|
UIUserNotificationTypeBadge
|
UIUserNotificationTypeSound
;
settings
=
[
UIUserNotificationSettings
settingsForTypes
:
types
categories
:
nil
];
[
self
.
commandDelegate
runInBackground
:
^
{
[[
UIApplication
sharedApplication
]
...
...
@@ -257,14 +260,16 @@
*/
-
(
BOOL
)
hasPermissionToSheduleNotifications
{
if
([[[
UIDevice
currentDevice
]
systemVersion
]
floatValue
]
>=
8
.
0
)
{
UIUserNotificationSettings
*
settings
=
[[
UIApplication
sharedApplication
]
currentUserNotificationSettings
];
if
(
IsAtLeastiOSVersion
(
@"8.0"
))
{
UIUserNotificationType
types
;
UIUserNotificationSettings
*
settings
;
settings
=
[[
UIApplication
sharedApplication
]
currentUserNotificationSettings
];
UIUserNotificationType
requiredTypes
=
UIUserNotificationTypeAlert
|
UIUserNotificationTypeBadge
|
UIUserNotificationTypeSound
;
types
=
UIUserNotificationTypeAlert
|
UIUserNotificationTypeBadge
|
UIUserNotificationTypeSound
;
return
(
settings
.
types
&
requiredT
ypes
);
return
(
settings
.
types
&
t
ypes
);
}
else
{
return
YES
;
}
...
...
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