tripflex / WifiWizard2

A Cordova plugin for managing Wifi networks (new version of WiFiWizard) - Latest is version 3+
https://www.npmjs.com/package/cordova-plugin-wifiwizard2
Apache License 2.0
123 stars 146 forks source link

getConnectedSSID() Not returning SSID when building IPA for distribution #53

Closed GiancarloGomez closed 6 years ago

GiancarloGomez commented 6 years ago

Description

When I debug my Ionic App I can get my SSID when I call getConnectedSSID() but in the IPA for release it never returns a value. Always fires the catch() and returns Not Available.

Steps to Reproduce

Build for prod thru CLI or Archive in xCode and export IPA and install on connected device via device window.

Expected behavior: Get Connected SSID like it does when debugging app

Actual behavior: Returns Not Available

Reproduces how often: 100%

Versions

iOS 12

msari-ipe-ext-1 commented 6 years ago

Yes the entitlement changed in iOS, this needs to be added to the plugin.xml and you need to update your entitlements

    <config-file parent="com.apple.developer.networking.wifi-info" target="*/Entitlements-Release.plist">
        <true />
    </config-file>
    <config-file parent="com.apple.developer.networking.wifi-info" target="*/Entitlements-Debug.plist">
        <true />
    </config-file>
GiancarloGomez commented 6 years ago

Hello, first of, thank you so much for responding. I added to the plugin.xml file under /plugins/wifiwizard2/plugin.xml and I have Access WiFi Information enabled under capabilities in xCode and under Application Services on the AppID on Apple Developer Account portal. It is still coming over as an empty string. Is there something I am missing? I know you stated update my Entitlements and just wanted to make sure what I did is what you meant.

GiancarloGomez commented 6 years ago
screen shot 2018-10-03 at 11 25 31 am
JamesCrowMedia commented 6 years ago

@GiancarloGomez Find your Entitlements-Debug.plist and Entitlements-Release.plist files and make sure the following is included in both:

<key>com.apple.developer.networking.wifi-info</key>
    <true/>

The xCode GUI did not properly add that line to the Entitlements-Release.plist file, so it was working for me on local builds, but not after publishing. After manually adding that line to Entitlements-Release.plist, WifiWizard2 is now working on TestFlight.

GiancarloGomez commented 6 years ago

Thank you! Thank you! Thank you!!!!! That was it!!!!

Thank you, Giancarlo Gomez http://giancarlogomez.com

From: James Crow notifications@github.com notifications@github.com Reply: tripflex/WifiWizard2 reply@reply.github.com reply@reply.github.com Date: October 4, 2018 at 2:15:25 AM To: tripflex/WifiWizard2 wifiwizard2@noreply.github.com wifiwizard2@noreply.github.com Cc: Giancarlo Gomez giancarlo.gomez@gmail.com giancarlo.gomez@gmail.com, Mention mention@noreply.github.com mention@noreply.github.com Subject: Re: [tripflex/WifiWizard2] getConnectedSSID() Not returning SSID when building IPA for distribution (#53)

@GiancarloGomez https://github.com/GiancarloGomez Find your Entitlements-Debug.plist and Entitlements-Release.plist files and make sure the following is included in both:

com.apple.developer.networking.wifi-info
<true/>

The xCode GUI did not properly add that line to the Entitlements-Release.plist file, so it was working for me on local builds, but not after publishing. After manually adding that line to Entitlements-Release.plist, WifiWizard2 is now working on TestFlight.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tripflex/WifiWizard2/issues/53#issuecomment-426897724, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJS17St0fD2SXwH90VzX_LMWoPpVMW5ks5uhad8gaJpZM4W32xM .

tripflex commented 6 years ago

Thanks guys, this should be resolved with latest PR that was just merged 4578a2d66d8404f02759efb62a2b96004ad50d20 please let us know if you have issues using latest master with this update added