Forum Xamarin.iOS

Problem with HotspotConfiguration and Entitlement

WelingtonBRWelingtonBR Member ✭✭
edited October 2018 in Xamarin.iOS

Hi,

I have a code in visual studio for windows which has most of functions working properly. I can debug on Iphone SE using breakpoints normally.

The problem is that i can not connect to wifi, even with hotspot and network extension enabled in entitlemente and my apple developer acount.

Follow my code which a use to connect:

     var wifiManager = new NEHotspotConfigurationManager();
     var wifiConfig = new NEHotspotConfiguration(ssid,password,false);
     wifiManager.Applyconfiguration(wifiConfig,(error) =>
     {
        if(error!=null) System.Diagnostics.Debug.Write(error.Description);
        // else connected

}

I get the errror: "Error Domain = NEHotspotConfigurationErrorDomain Coder=8 "internal error." UserInfo={NSLocalizedDescription=internal error.}

Do you have any idea how to solve that?

Best Answer

  • WelingtonBRWelingtonBR Member ✭✭
    Accepted Answer

    @RobertAuer and @LandLu

    The problem is in automatic provisioning.

    I have to change it to manual and load entiltlement manually on my project configurations.

    Thank you for your answers.

    Best Regards

Answers

  • WelingtonBRWelingtonBR Member ✭✭

    this is my entitlemente:

        <dict>
            <key>aps-environment</key>
            <string>development</string>
            <key>com.apple.developer.networking.wifi-info</key>
            <true/>
            <key>com.apple.developer.networking.networkextension</key>
            <true/>
            <key>com.apple.external-accessory.wireless-configuration</key>
            <true/>
            <key>com.apple.developer.icloud-container-identifiers</key>
            <array>
                <string>iCloud.com.Qualitronix.QIWAPP</string>
            </array>
            <key>com.apple.developer.networking.HotspotConfiguration</key>
            <true/>
        </dict>
        </plist>
    

    On device log, I can read: NEHelperHotspotConfigurationManager process appname.iOS[331] is missing the com.apple.developer.networking.HotspotConfiguration entitlement.

  • LandLuLandLu Member, Xamarin Team Xamurai

    com.apple.developer.networking.networkextension should be a string array. Usually we set it like:

    <key>com.apple.developer.networking.networkextension</key>
    <array>
        <string>app-proxy-provider</string>
        <string>content-filter-provider</string>
        <string>packet-tunnel-provider</string>
    </array>
    
  • WelingtonBRWelingtonBR Member ✭✭

    Hello LandLu, thanks for your reply.

    I continue getting the same error.

    Any idea?

  • WelingtonBRWelingtonBR Member ✭✭

    Anyone can help me?

  • RobertAuerRobertAuer USMember ✭✭

    You need to go into your Entitlements.plist and select the Access to WiFi Information and you also need to make sure that your certificate in Apple is set to allow it.

  • WelingtonBRWelingtonBR Member ✭✭

    It didn't work.

    Should I use native reference "NetworkExtension.framework"?
    I tested a sample code for xcode in swift and I could connect to a specific network. There is this reference included there.

  • WelingtonBRWelingtonBR Member ✭✭
    Accepted Answer

    @RobertAuer and @LandLu

    The problem is in automatic provisioning.

    I have to change it to manual and load entiltlement manually on my project configurations.

    Thank you for your answers.

    Best Regards

Sign In or Register to comment.