Code Monkey home page Code Monkey logo

Comments (6)

cbaker6 avatar cbaker6 commented on May 18, 2024

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.

vdkdamian avatar vdkdamian commented on May 18, 2024

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.

cbaker6 avatar cbaker6 commented on May 18, 2024

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:

DispatchQueue.main.async {
_ = BaseParseInstallation()
}

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 }
        }
    }
  1. If you're making changes to fields in Installation or using Installation for something else.

from parse-swift.

cbaker6 avatar cbaker6 commented on May 18, 2024

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.

cbaker6 avatar cbaker6 commented on May 18, 2024

Closing due to the question being answered and inactivity. Feel free to reopen if needed.

from parse-swift.

cbaker6 avatar cbaker6 commented on May 18, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.