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
class MyHomePage extends StatefulWidget { | |
@override | |
_MyHomePageState createState() => _MyHomePageState(); | |
} | |
class _MyHomePageState extends State<MyHomePage> { | |
String name; | |
String saveFormat; | |
String objectId; |
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
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
final HttpLink httpLink = HttpLink( | |
uri: kUrl, | |
headers: { | |
'X-Parse-Application-Id' : kParseApplicationId, | |
'X-Parse-Client-Key' : kParseClientKey, | |
'X-Parse-Master-Key': kParseMasterKey, | |
//'X-Parse-REST-API-Key' : kParseRestApiKey, |
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
import 'package:flutter/material.dart'; | |
import 'package:graphql_flutter/graphql_flutter.dart'; | |
import 'consonents.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override |
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
render() { | |
return ( | |
<View style={styles.container}> | |
<Text style={styles.welcome}>React Native on Back4App</Text> | |
<Text style={styles.instructions}>Reading objects tutorial</Text> | |
<TouchableOpacity onPress={() => this.saveNewPerson() } style={styles.button}> | |
<Text style={styles.buttonText}>Save</Text> | |
</TouchableOpacity> |
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
retrievePerson = async () => { | |
var Person = Parse.Object.extend("Person"); | |
var query = new Parse.Query(Person); | |
query.get("b90N1cYpR8") | |
.then((person) => { | |
var name = person.get("name"); | |
var age = person.get("age"); |
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
render() { | |
return ( | |
<View style={styles.container}> | |
<Text style={styles.welcome}>React Native on Back4App</Text> | |
<Text style={styles.instructions}>Saving new objects tutorial</Text> | |
<TouchableOpacity onPress={() => this.saveNewPerson() } style={styles.button}> | |
<Text style={styles.buttonText}>Save</Text> | |
</TouchableOpacity> |
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
saveNewPerson = async () => { | |
var Person = Parse.Object.extend("Person"); | |
var person = new Person(); | |
person.set("name", "John Snow"); | |
person.set("age", 27); | |
try{ | |
let result = await person.save() | |
alert('New object created with objectId: ' + result.id); |
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
person.set("name", "John Snow"); | |
person.set("age", 27); |
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
// Simple syntax to create a new subclass of Parse.Object. | |
var Person = Parse.Object.extend("Person"); | |
// Create a new instance of that class. | |
var person = new Person(); |
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
<html> | |
<head></head> | |
<body> | |
<script type="text/javascript"> | |
(async () => { | |
const response = await fetch( | |
'https://parseapi.back4app.com/classes/City', | |
{ | |
headers: { | |
'X-Parse-Application-Id': 'mxsebv4KoWIGkRntXwyzg6c6DhKWQuit8Ry9sHja', |