Explorar o código

Escape special key

Sebastián Katzer %!s(int64=11) %!d(string=hai) anos
pai
achega
60af42b4d3
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      src/ios/APPLocalNotification.m

+ 3 - 0
src/ios/APPLocalNotification.m

@@ -604,6 +604,9 @@
         NSString* json = notification.options.json;
         NSString* args = [notification encodeToJSON];
 
+        json = [json stringByReplacingOccurrencesOfString:@"'"
+                                               withString:@"\\\\\\'"];
+
         params = [NSString stringWithFormat:
                   @"\"%@\",\"%@\",\\'%@\\',JSON.parse(\\'%@\\')",
                   id, self.applicationState, json, args];