Skip to content

Commit

Permalink
Merge pull request #7 from FuckBoilerplate/issue_save_token
Browse files Browse the repository at this point in the history
Now the registrationToken is getting saved in RegistrationHandler
  • Loading branch information
robertofrontado authored Jul 3, 2016
2 parents 0e28ddb + 0bbd598 commit 313831b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Sources/RxGcm.swift
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,11 @@ public class RxGcm: NSObject, GGLInstanceIDDelegate {
// MARK: - GCM Methods
private func registrationHandler(registrationToken: String!, error: NSError!) {
if (registrationToken != nil) {
self.registrationToken = registrationToken
print("Registration Token: \(registrationToken)")
self.subscribeToTopic()
self.onTokenRefreshed()
self.registrationToken = registrationToken
persistence.saveToken(registrationToken)
subscribeToTopic()
onTokenRefreshed()
} else {
print("Registration to GCM failed with error: \(error.localizedDescription)")
}
Expand Down

0 comments on commit 313831b

Please sign in to comment.