This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log("Starting function"); | |
// TODO: find a way to pull the admin_token.base64 without copying and pasting it | |
const Realm = require('realm'); | |
const adminUser = Realm.Sync.User.adminUser('******'); | |
const server_url = 'realm://****.com:9080'; | |
module.exports = function(changeEvent) { | |
console.log('Change detected at path: ' + changeEvent.path); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SyncUser.logIn(with: credentials, | |
server: RealmURL.authentication, | |
timeout: 10) { user, error in | |
if let user = user { | |
print("Successfully signed in.") | |
let appDel = UIApplication.shared.delegate as! AppDelegate | |
appDel.initializeRealmConfigs() | |
let _ = RealmHelper.getRealmFor(configuration: RealmConfig.userObjectRealm!) |
NewerOlder