1

Trying to setup a hybrid_remote mobile ios app using the forceios and not able to bypass the login screen. Here is what I did:

Step 1. forceios create

    Enter your application type (native, native_swift, react_native, hybrid_remote, or hybrid_local): hybrid_remote
    Enter your application name: bp_mobile
    Enter the output directory for your app (defaults to the current directory): 
    Enter the package name for your app (com.mycompany.my_app): com.bp.mobile
    Enter your organization name (Acme, Inc.): bp
    Enter the start page for your app (only applicable for hybrid_remote apps): bpsbox1-bp.cs10.force.com/BPMobile/BP_Community_Splash
    Enter your Connected App ID (defaults to the sample app's ID): 
    Enter your Connected App Callback URI (defaults to the sample app's URI): 
    Using cordova CLI version 6.0.0 to create the hybrid app.
    Creating a new cordova project.

Step 2. cordova platform add ios

Step 3. cordova prepare

Step 4: Open bp_mobile.xcodeproj

Step 5: Add SFDCOAuthLoginHost to plist

enter image description here

When I open the app on the emulator it wants to login to Salesforce. I don't need authentication enabled for the mobile as authentication is done by community app login page which is a visualforce page. When I look at bootconfig.json:

{
      "remoteAccessConsumerKey": "3MVG9Iu66FKeHhINkB1l7xt7kR8czFcCTUhgoA8Ol2Ltf1eYHOU4SqQRSEitYFDUpqRWcoQ2.dBv_a1Dyu5xa",
      "oauthRedirectURI": "testsfdc:///mobilesdk/detect/oauth/done",
      "oauthScopes": [
        "web",
        "api"
      ],
      "isLocal": false,
      "startPage": "bpsbox1-bp.cs10.force.com/BPMobile/BP_Community_Splash",
      "errorPage": "error.html",
      "shouldAuthenticate": true,
      "attemptOfflineLoad": false
}

When I change shouldAuthenticate to false the app fails and throws and exception.

0

Can you make sure you have the latest version of the mobile sdk:

npm install -g forceios

Then try with the steps here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.