Coder Social home page Coder Social logo

Comments (15)

EddyVerbruggen avatar EddyVerbruggen commented on August 19, 2024

Is this iOS or Android?

from nativescript-email.

firescript avatar firescript commented on August 19, 2024

This is on iOS, its really quite random though. Like right now my device is plugged in and i'm running on livesync and i'm not seeing either of these issues happen.

from nativescript-email.

EddyVerbruggen avatar EddyVerbruggen commented on August 19, 2024

I've seen this happen on the simulator only, not on a device yet. Which iOS version is this (and which device)?

from nativescript-email.

firescript avatar firescript commented on August 19, 2024

I am running 9.3 and its a 6s

from nativescript-email.

EddyVerbruggen avatar EddyVerbruggen commented on August 19, 2024

I have a strong suspicion this line should be in a broader scope. That MFMailComposeViewController may be garbage collected when the composer is open (and your app is in the background). I just remembered a similar issue I've seen in a Cordova plugin.

from nativescript-email.

EddyVerbruggen avatar EddyVerbruggen commented on August 19, 2024

Another cause could be the animated hiding of the compose and your app perhaps performing a transition at the same time (or showing a dialog).

from nativescript-email.

firescript avatar firescript commented on August 19, 2024

Okay so the second scenario i'm not doing in my app, i'm letting your plugin return to the same view it was initiated from. When i built it for messenger plugin, this is where i allocated:

https://github.com/firescript/nativescript-messenger/blob/master/index.ios.js#L53

from nativescript-email.

EddyVerbruggen avatar EddyVerbruggen commented on August 19, 2024

Interesting line of code
🤔🤔🤔🤔🤔

from nativescript-email.

firescript avatar firescript commented on August 19, 2024

Yeah that addition was from @ivanbuhov pretty sure I was having weird closing issues before. Thats when we added that

from nativescript-email.

EddyVerbruggen avatar EddyVerbruggen commented on August 19, 2024

can you add that locally to this plugin and keep an eye on it perhaps?

from nativescript-email.

firescript avatar firescript commented on August 19, 2024

The initial part needs to be wrapped in a NSObject.extend to create the delegate, it started getting a little over my head when @ivanbuhov took over lol, I can try and play around with it though!

from nativescript-email.

EddyVerbruggen avatar EddyVerbruggen commented on August 19, 2024

Let me know if you can pull it off, otherwise I'll take a look later this week. Thanks!

from nativescript-email.

ivanbuhov avatar ivanbuhov commented on August 19, 2024

The idea behind this line is to keep the delegate instance alive. Since the messageComposeDelegate is weak it will not retain the delegate instance and after the JS wrapper is collected, the native instance will be deallocated, too. Explicitly retaining and releasing the delegate prevents its preliminary deallocation.

from nativescript-email.

grasshoppermouse avatar grasshoppermouse commented on August 19, 2024

I'm having similar problems as well. After sending an email, sometimes the app crashes. Other times the app returns to the view it was initiated from, but the screen is frozen. No errors in the console (and this is not run: console.log("Email composer closed");). Sometimes it returns from sending an email without errors.

from nativescript-email.

EddyVerbruggen avatar EddyVerbruggen commented on August 19, 2024

@grasshoppermouse Thanks for reminding me of this issue - totally slipped my radar. Just released 1.3.4 which should fix this.

from nativescript-email.

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.