Closed memishood closed 5 years ago
Did you find the solution?
Yes, when i run the server i used to npm start so it's generate a new index.js as your config.json keys, i was thinking its same with node index.js, i use node index.js and no problem anymore, thank you
I use a remote http parse server (2.8.4 parse server version) - (Google cloud compute engine - windows server 2016) and i created a custom Posts class on Dashboard and i tried LiveQuery for Android, i saved any object to Post class but LiveQuery didn't worked
App class:
` val configuration = Parse.Configuration.Builder(this) .applicationId(getString(R.string.parse_server_app_id)) .clientKey(null) .server(getString(R.string.parse_server_url)) .build()
` manifest application: name = ".App"
MainActivity: ` val parseLiveQueryClient: ParseLiveQueryClient = ParseLiveQueryClient.Factory.getClient() // when i tried getClient(URI("ws://185.*.*.:1337/")) it gives Expected HTTP 101 response but was '404 Not Found' val parseQuery: ParseQuery = ParseQuery.getQuery("Posts")
val subscriptionHandling = parseLiveQueryClient.subscribe(parseQuery)
Handler().postDelayed(Runnable { Log.d(this.tag,"Started push") val pObject = ParseObject.create("Posts") pObject.put("Sub","Hello") pObject.put("Message","There!") pObject.saveInBackground() },5000)
Server side:
var api = new ParseServer({ databaseURI: databaseUri || 'mongodb://*, cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js', appId: process.env.APP_ID || 'tjlF', masterKey: process.env.MASTER_KEY || 'fg**', serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse', liveQuery: { classNames: ['Posts', 'Comments'] // List of classes to support for query subscriptions } }); var httpServer = require('http').createServer(app); httpServer.listen(port, function() { console.log('parse-server-example running on port ' + port + '.'); }); ParseServer.createLiveQueryServer(httpServer); `it gives Expected HTTP 101 response but was '403 Forbidden' for response when i tried LiveQuery, anyone can help me ?