Skip to content

Conversation

@radiKal07
Copy link

Added support to configure this params, fixing this issue: transistorsoft/transistor-background-fetch#6

I am not familiar with Objective-C or the way to build a .framework and I am not sure what's with the _CodeResources folder, so please review these thoughtfully.

@christocracy
Copy link
Member

Not bad.

@radiKal07
Copy link
Author

Using my version via git dependency I get the following error: missing required architecture arm64 in file. So I think I messed up something regarding the way I built the .framework. Looking into it, as I said I am not familiar with Obj-C packages.

@radiKal07
Copy link
Author

Ok, fixed the issue but now _CodeSignature folder got deleted, not sure if this is an issue

@christocracy
Copy link
Member

Sorry, I can't accept this PR as-is. The plugin already has existing config options requiresCharging and requiredNetworkType (used by Android) which can be applied for iOS.

@christocracy
Copy link
Member

Also, you're sending null values to the native iOS side from toMapwhen those values are not provided.

{
  stopOnTerminate: false, 
  enableHeadless: true, 
  forceAlarmManager: true, 
  requiresExternalPower: null, 
  requiresNetworkConnectivity: null
}

Which crashes iOS.

'NSInvalidArgumentException', reason: '-[NSNull boolValue]: unrecognized selector sent to instance 0x7fff80618070'

@radiKal07
Copy link
Author

radiKal07 commented Mar 18, 2020

@christocracy
I think we can re-use requiresCharging param but nor sure about requiredNetworkType since it's an enum on Android and a bool on iOS. Do you think NetworkType.NONE should be false on iOS and anything else true? I would rather separate them because someone can get confused. For example someone may use NetworkType.CELLULAR thinking it would work on iOS also but the job will get executed even if there is wifi. What do you think?

Btw, regarding the second comment I initialise the variables to false, so that happens only if user explicitly passes null which is weird but I will provide a fix to treat that case also.

@radiKal07
Copy link
Author

@christocracy I pushed new commit where I re-use the requiresCharging param for iOS and fixed the requiresNetworkConnectivity: null crash. Still not sure about requiredNetworkType enum vs requiresNetworkConnectivity bool

@radiKal07
Copy link
Author

@christocracy any updates on this?

@radiKal07
Copy link
Author

@christocracy ping

@proninyaroslav
Copy link

@christocracy
The implementation of this feature would be very helpful.

@radiKal07
Copy link
Author

@christocracy fixed conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants