apla / me.apla.cordova.app-preferences

App preferences plugin for cordova
Apache License 2.0
201 stars 210 forks source link

IOS - prefences pane stays empty - just permissions like camera are shown... #76

Open OliverTr54 opened 8 years ago

OliverTr54 commented 8 years ago

Hey there,

I really have an urgent issue.

I would like to create a prefence panel for my application, but it doesn't matter how and what I try - it's not working.

I followed the documentation, but the app prefence pane always shows the permissions - only, but not the preference of the app-settings.json. I left the app-settings.json like it was after I added the plugin.

[
    {
        "type":"group",
        "title":"Common",
        "items":[{
            "title":"Title",
            "type":"textfield",
            "key":"title"
        }, {
            "title":"Language",
            "type":"radio",
            "key":"lang",
            "default": "en",
            "items":[{
                "value":"**en**",
                "title":"English (US)"
            }, {
                "value":"de",
                "title":"Deutsch (DE)"
            }]
        }, {
            "title":"Debug",
            "type":"toggle",
            "default":false,
            "key":"debug"
        }]
    }
]

I also did a "phonegap prepare" afterwards and I build my package for IOS on build.phonegap...., but it still does not appear.

I use ng-cordova to access the preferences page - which works fine, but I'm not able to store any values or import the app-settings.json.

What's wrong?

The generated Settings.bundle is located in APPNAME/platforms/ios/Settings.bundle. It contain "Root.plist" the ".me.apla.apppreferences" file and a subfolder en.lproj.

I also tried it by moving it onto the APPNAME/platforms/ios/APPNAME/Resources folder but it won't work either.

I also added the plugin into the APPNAME/config.xml, by adding the following line: <plugin name="cordova-plugin-app-preferences" spec="0.7.6" />

Do I have to add a "feature", e.g.

    <feature name="AppPreferences">
        <param name="ios-package" value="AppPreferences"/>
    </feature>

I tried really everthing but without any success :(

Just by the way - I use phonegap 5.3.10 and node 5.4.0.

Please let me know, if you have a solution to solve this issue.

Thanks, Oliver

OliverTr54 commented 8 years ago

Is no one able to tell me any solution attached to this problem? I really need some help :( @apla

apla commented 8 years ago

Very strange issue. Probably Xcode thinks Settings.bundle is located elsewhere. Try to open Xcode after prepare, click on Settings.bundle and locate it.

Also, can you create test app and add a plugin. Do you see any preferences?

OliverTr54 commented 8 years ago

I currently develop this project with Phonegap and Angular + Ng-Cordova. The build is actually done by "build.phonegap.com" - I don't have Xcode running anywhere... is this the problem?

When I start my application it does show me the preference page, but it does not store any key, but it also does not throw any exception.

Thanks in advance, Oliver

apla commented 8 years ago

I don't have experience with phonegap, do you have an access to the built files? If yes, then I need strings containing 'Settings.bundle' from your project file.

On unix, command grep 'Settings.bundle' platforms/ios/*.xcodeproj/project.pbxproj can do this.

OliverTr54 commented 8 years ago

It seems to be in there...

                EA419C208B1C4D2299117565 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = FAEEF545C4DC4D59855CC2B2 /* Settings.bundle */; };
                FAEEF545C4DC4D59855CC2B2 /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = "Settings.bundle"; path = "Settings.bundle"; sourceTree = SOURCE_ROOT; };
                                FAEEF545C4DC4D59855CC2B2 /* Settings.bundle */,
                                EA419C208B1C4D2299117565 /* Settings.bundle in Resources */,

That's all I can grep for :(

I really have no idea what's wrong? Do I have to add something specific inside the projects "config.xml"? The plugin source is in here and the "feature" xml.

I only have the Settings.bundle in the root path of the platform project, e.g. PROJECT/platform/ios/Settings.bundle (check) PROJECT/platform/ios/PROJECT_NAME/Resources/Settings.bundle (MISSING!)

apla commented 8 years ago

The most important flag is sourceTree = SOURCE_ROOT, it defines that Settings.bundle is located in SOURCE_ROOT, which is usually platforms/ios. My test application has the same references.

As I understand, you're building app via phonegap, then you're uploading your app to the real device. Are you using Hydration feature? If so, Settings.bundle definitely won't be updated between builds.

OliverTr54 commented 8 years ago

I use https://build.phonegap.com/ which compiles the phonegap project to IOS and Android, but I don't use Hydration... What else could it be? Do you know any phonegap developer with an issue like this?

apla commented 8 years ago

I will try to build test project on phonegap on Saturday to find out differences between cordova and phonegap

On Feb 4, 2016, at 6:56 PM, OliverTr54 notifications@github.com wrote:

I use https://build.phonegap.com/ which compiles the phonegap project to IOS and Android, but I don't use Hydration... What else could it be? Do you know any phonegap developer with an issue like this?

— Reply to this email directly or view it on GitHub.

OliverTr54 commented 8 years ago

Thank you! Please keep me up to date...

OliverTr54 commented 8 years ago

Any news available? @apla

OliverTr54 commented 8 years ago

Where you able to reproduce the error? @apla

apla commented 8 years ago

@OliverTr54 I have some issues with application installation from Phonegap.com service. Really limited on time last week, try to resolve it in a few days.

OliverTr54 commented 8 years ago

Alright. I'm really in the need to use your module in my application somehow...

apla commented 8 years ago

I've compiled and installed application using phonegap build ios and phonegap run ios and settings displays fine. Launching phonegap run ios after new preference generation I've faced empty preference screen. Removing app from device and install it again did the trick — now preferences displayed.

Also after inspecting phonegap build logs I've found this issue: https://github.com/phonegap/build/issues/425. I don't know will this issue is about your situation or not.

OliverTr54 commented 8 years ago

I'll will try this. Hopefully it works @apla

mark-roper commented 7 years ago

I'm having a similar problem, but I am compiling my app with xcode.

If I start with a "clean slate", i.e. do a hard reboot to ensure no apps are running on the iPad, then install the app, the preferences I've defined appear in Settings. So far so good.

If I un-install the app the preferences disappear from Settings. Also so far so good.

If I then re-install the app the preferences sometimes do not re-appear in Settings. Not good.

It appears if the Settings app is still running, even in the background, it can interfere with preferences being added. However it's not every time. Sometimes un-install / re-install re-adds preferences, sometimes it doesn't, and I can't come up with a scenario in which it always fails or always works.

This is on an iPad2 with iOS 9.3.5, I don't currently have an iPad to hand with iOS 10.

jakob-lundberg commented 7 years ago

I did a workaround to add Settings.bundle to Phonegap Build. By creating a plugin the Settings.bundle can be added as a resource.

http://stackoverflow.com/questions/22511548/cordova-phonegap-ios-app-settings-bundle-possible