Comments (6)
Can you share your Installation
ParseObject and any ParseObjects it embeds?
Also, is there a reason you are attempting to save your installation every time right after you initialize the SDK?
from parse-swift.
I thought the Installation needs to happen every time, how do I make sure it only happens a single time?
I also want to mention that the first time it does the installation, it returns no errors.
So it's probably because I try to do it every launch.
But where do I put the installation code then? Is this something we need to check ourselves if it already did the installation?
from parse-swift.
I thought the Installation needs to happen every time, how do I make sure it only happens a single time?
You are not required to save the installation. It's created automatically and saved to your Keychain in ParseSwift.initialize
:
Parse-Swift/Sources/ParseSwift/Parse.swift
Lines 64 to 66 in 0b0d775
There are only two times I can think of needing to save it to the Cloud: 1) is when you need it for push notifications. In that case, the only save that's needed occurs in the AppDelegate or equivalent (the OS will call this method whenever deviceToken
changes):
func application(_ application: UIApplication,
didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
DispatchQueue.main.async {
guard var currentInstallation = Installation.current else {
return
}
currentInstallation.setDeviceToken(deviceToken)
currentInstallation.channels = ["global"]
currentInstallation.save { _ in }
}
}
- If you're making changes to fields in Installation or using Installation for something else.
from parse-swift.
The error on your update of Installation might be linked to something with how back4app sends dates. I recommend keeping an eye on this post https://community.parseplatform.org/t/error-decoding-parse-server-response/1446/14
from parse-swift.
Closing due to the question being answered and inactivity. Feel free to reopen if needed.
from parse-swift.
@novemTeam I think the Installation problems you were having should be fixed in version 1.3.0. In this version you no longer need to wrap installation calls in dispatch closures. Let us know if it resolves the issues you had.
You can see the linked PRs and issues for details.
from parse-swift.
Related Issues (20)
- Remove duplicate docs HOT 4
- Allow implementations of ParseObjects to set their own className HOT 7
- Allow implementations of ParseObjects to set their own className HOT 4
- Nested ParseFile saves invalid data HOT 1
- Auto-reuse existing installation object when migrating from ObjC SDK HOT 7
- Add offline object saving HOT 26
- Delete installation is impossible HOT 7
- Parse.User save not dispatching back to callback queue when result is success HOT 5
- 📣 Contributors wanted! HOT 1
- Parse Analytics - Track App Opened HOT 1
- ParseConfig throwing Codable errors when type `Object` exists in Config. HOT 1
- Unable to parse the exact error from ParseError HOT 1
- Fatal error: Duplicate elements of type 'ParseFile' were found in a Set. This usually means either that the type violates Hashable's requirements, or that members of such a set were mutated after insertion HOT 1
- Does not support automatic/anonymous user HOT 1
- When is the next release? HOT 2
- Crash: Installation.current setter not thread safe HOT 1
- Request: Make backingStore optional rather than force unwrapped HOT 2
- PFFacebookUtils' has no member 'initializeFacebookWithLaunchOptions HOT 1
- Count return 0 HOT 1
- Does not build against visionOS target HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parse-swift.