Proyectos de Subversion Iphone Microlearning - Nuevo Interface

Rev

Rev 25 | Rev 31 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 25 Rev 27
Línea 174... Línea 174...
174
        let newCapsules = Int(userInfo["new_capsules"] as? String ?? "") ?? 0
174
        let newCapsules = Int(userInfo["new_capsules"] as? String ?? "") ?? 0
Línea 175... Línea 175...
175
 
175
 
176
    
176
    
-
 
177
        if command == "signout" {
177
        if command == "signout" {
178
            NotificationCenter.default.post(name: Constants.NOTIFICATION_NAME_COMMAND_EXIT , object: self, userInfo: nil)
-
 
179
        } else if command == "content-refresh" && newCapsules > 0 {
-
 
180
            let userinfo = [
178
            NotificationCenter.default.post(name: Constants.NOTIFICATION_NAME_COMMAND_EXIT , object: self, userInfo: nil)
181
                "title" : title,
179
        }
182
                "body" : body,
-
 
183
                "new_capsules" : String(newCapsules),
Línea 180... Línea 184...
180
        if command == "content-refresh" && newCapsules > 0 {
184
                "is_foreground" : (isForeground ? "1" : "0")
181
            let userinfo = ["new_capsules" : String(newCapsules), "is_foreground" : (isForeground ? "1" : "0")]
-
 
182
            
-
 
183
            NotificationCenter.default.post(name: Constants.NOTIFICATION_NAME_COMMAND_REFRESH_CONTENT , object: self, userInfo: userinfo)
-
 
184
        }
-
 
185
        
-
 
186
        
-
 
187
        if !title.isEmpty && !body.isEmpty {
-
 
188
 
-
 
189
 
-
 
190
            if !url.isEmpty {
-
 
191
                command = Constants.NOTIFICATION_COMMAND_OPEN_URL
185
            ]
192
            } else if newCapsules > 0 {
-
 
193
                command = Constants.NOTIFICATION_COMMAND_REFRESH_CONTENT
-
 
Línea -... Línea 186...
-
 
186
            
-
 
187
            NotificationCenter.default.post(name: Constants.NOTIFICATION_NAME_COMMAND_REFRESH_CONTENT , object: self, userInfo: userinfo)
-
 
188
        } else {
-
 
189
            
-
 
190
            let userinfo = [
Línea 194... Línea -...
194
            } else {
-
 
195
                command = ""
-
 
196
            }
-
 
197
            
-
 
198
            
191
                "title" : title,
Línea 199... Línea 192...
199
            userNotification = UserNotificationModel(userUuid: appData.userUuid, title: title, body: body, viewed: command.isEmpty ? 1 : 0, url: url, command: command, dateOn: dateOn, timeOn: timeOn)
192
                "body" : body,
200
            
193
                "url" : url,