Git Product home page Git Product logo

Comments (5)

mike4aday avatar mike4aday commented on September 12, 2024

Hi @chaitba2. To the best of my knowledge, it's not possible to remove the "Cancel" button from the top left of Apple's presented authentication view. Swiftly Salesforce users ASWebAuthenticationSession and there isn't a configuration parameter to hide the "Cancel" button -- which may be for the best, since there needs to be a way for the user to dismiss the modal.

Swiftly Salesforce will return a cancellation error if the user does tap "Cancel" - that is, you can detect the difference between the user canceling the Salesforce authentication vs. failing to authenticate.

from swiftlysalesforce.

mike4aday avatar mike4aday commented on September 12, 2024

@chaitba2 I will mark this issue as 'closed' but if I didn't answer your question, please reopen.

from swiftlysalesforce.

mike4aday avatar mike4aday commented on September 12, 2024

@chaitba2 I realized I forgot to address your second question: "Also is there a way to bypass login alert?" -- I'll reopen the issue now.

Please elaborate on what you mean by "bypass"? What are you trying to accomplish? Do you want to authenticate to Salesforce with a different OAuth flow, e.g. username-password flow (which is not recommended)? Or are you trying to have Swiftly Salesforce not display the login form when the user's session has expired and your app makes a call to Salesforce?

from swiftlysalesforce.

chaitba2 avatar chaitba2 commented on September 12, 2024

I want to skip the alert and go directly to the login page. Attached the screenshot of alert.
I tried the following to skip the alert,

in WebAuthenticationSession class, changed the below line from false to true
session.prefersEphemeralWebBrowserSession = true

and to display login again using the following code with delay

DispatchQueue.main.asyncAfter(deadline: .now() + 0.5, execute: {
    Task {
        await login()
     }
})

Please correct me if am wrong.

Simulator Screenshot - iPad Pro (12 9-inch) (6th generation) (16GB) - 2023-12-05 at 10 03 05

from swiftlysalesforce.

mike4aday avatar mike4aday commented on September 12, 2024

@chaitba2 personally I don't like to rely on the delay and I find it hard to 'reason' about what else is going on during that delay. Does it work for you? Why do you not want the alert to display? IMO the alert is common in iOS apps so users aren't put off by it and the code is cleaner.

from swiftlysalesforce.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.