Skip to content

Today Extension getting Error @ runtime using ios@1.5.2 #503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ravindragupta90 opened this issue Feb 8, 2016 · 4 comments
Closed

Today Extension getting Error @ runtime using ios@1.5.2 #503

ravindragupta90 opened this issue Feb 8, 2016 · 4 comments

Comments

@ravindragupta90
Copy link

issue faced : EXC_BAD_ACCESS at
runtime = [[TNSRuntime alloc] initWithApplicationPath:[NSBundle mainBundle].bundlePath];
on TodayWiget's main.m

Need to achive : want to create a Today's extension for iOS and update the label with the string which is saved in application-settings.

Approaches i have made :
My main application is in nativeScript, which i have built and created the extension from .xcodeproj in Xcode.

Approach 1 : I have followed this article (https://github.com/NativeScript/ios-runtime-docs/blob/d548447067a87ba7ed9af0b91bd8dc2ee1f486bb/extensions/TodayExtension.md) in Which i am getting this runtime error which is mention above. while following this article there was a line mentioned Under Setting up the MYTodayExtension Target Saying that "From the 'MYTodayApp' target's 'Build Phases' copy 'Generate Metadata' to the 'MYTodayExtension' target's 'Build Phases'." which i couldn't find in the xCode.

Approach 2 : I have created the TodayExtension as we create for normal iOS application. Which works perfectly. But i am unable to figure it out "How to get data from NSUserDefault". As i have also added the app-group compatibility, still i am facing the issue.

Did anyone else got it worked or faced same issue?
which above approach is advisable? or do we have some other approach?

@jasssonpet
Copy link
Contributor

Hello, @Ravindrans,

I've made some updates to the article. Let me know if this works for you.

@ravindragupta90
Copy link
Author

Hi @jasssonpet,

Thanks, now its working good. Now my only concern is to update the label of widget with the data which is saved to application-settings from app.js. I tried using this
var userDefaults = NSUserDefaults.standardUserDefaults().objectForKey("key");
and this var appSettings = require("application-settings"); var strShares = appSettings.getString("key", "Dummy String"); approach inside viewDidLoad() method. But still i am unable to get the data.
Can anyone help me with this?

@jasssonpet
Copy link
Contributor

I'm not quite familiar with iOS extension development, but did you take a look at this SO question.

@ravindragupta90
Copy link
Author

ya i had looked into this SO link previously. But it couldn't help me solve my issue.

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

No branches or pull requests

2 participants