Skip to content

Conversation

lposen
Copy link
Contributor

@lposen lposen commented Oct 7, 2025

🔹 JIRA Ticket(s) if any

✏️ Description

Added retry for iOS

Instructions

  • pull the branch
  • run the following:
     cd example/ios
     bundle exec pod deintegrate  
     rm -rf ~/Library/Developer/Xcode/DerivedData Pods Podfile.lock build ../Gemfile.lock
     bundle install
     bundle exec pod install
  • in a separate tab, run the following:
     cd example
     watchman watch-del-all
     yarn start --reset-cache
  • build the code, either through xcode or by running yarn ios
  • try login -- that should be successful
  • logout (you can find the button in the User tab)
  • Open example/src/hooks/useIterableApp.tsx
  • Uncomment the code block that starts with config.authHandler = () => {
  • Refresh the app (you can do this by focusing on the terminal in which you ran yarn start, then pressing r)
  • Try login again -- an error should pop up with the failure reason

Copy link

github-actions bot commented Oct 7, 2025

Lines Statements Branches Functions
Coverage: 46%
46.56% (224/481) 21.8% (41/188) 39.62% (63/159)

Copy link

qltysh bot commented Oct 7, 2025

Diff Coverage: The code coverage on the diff in this pull request is 100.0%.

Total Coverage: This PR will not change total coverage.

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

This is from Qlty Cloud, the successor to Code Climate Quality. Learn more.

*/
export enum IterableAuthFailureReason {
/**
* An auth token's expiration must be less than one year from its issued-at
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is changed because iOS gives back the numeric value instead of the string value

Copy link

qltysh bot commented Oct 7, 2025

2 new issues

Tool Category Rule Count
qlty Structure Function with high complexity (count = 6): setupUserNotificationCenter 1
qlty Structure Function with many returns (count = 8): IterableAppProvider 1

This is from Qlty Cloud, the successor to Code Climate Quality. Learn more.

…oid-br' into jwt/MOB-11032-task-4-ios-bridge-retrypolicy-and-authfailure
Comment on lines +79 to +101
private func setupUserNotificationCenter() {
UNUserNotificationCenter.current().delegate = self
UNUserNotificationCenter.current().getNotificationSettings { settings in
if settings.authorizationStatus != .authorized {
ITBInfo("Not authorized")
// not authorized, ask for permission
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { success, _ in
ITBInfo("auth: \(success)")
if success {
DispatchQueue.main.async {
UIApplication.shared.registerForRemoteNotifications()
}
}
// TODO: Handle error etc.
}
} else {
// already authorized
ITBInfo("Already authorized")
DispatchQueue.main.async {
UIApplication.shared.registerForRemoteNotifications()
}
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with high complexity (count = 6): setupUserNotificationCenter [qlty:function-complexity]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant