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: 48%
48.2% (228/473) 22.58% (42/186) 41.87% (67/160)

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
…oid-br' into jwt/MOB-11032-task-4-ios-bridge-retrypolicy-and-authfailure
…oid-br' into jwt/MOB-11032-task-4-ios-bridge-retrypolicy-and-authfailure
@lposen lposen marked this pull request as ready for review October 10, 2025 20:01
…oid-br' into jwt/MOB-11032-task-4-ios-bridge-retrypolicy-and-authfailure
@lposen lposen changed the title [MOB-11032] task-4-ios-bridge-retrypolicy-and-authfailure [MOB-11032] configure JWT for iOS Oct 14, 2025
@lposen lposen added the jwt label Oct 14, 2025
…oid-br' into jwt/MOB-11032-task-4-ios-bridge-retrypolicy-and-authfailure
Copy link
Member

@Ayyanchira Ayyanchira left a comment

Choose a reason for hiding this comment

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

Looking great!

completion(nil)
}
// TODO: RN should be able to handle nil case as well. Or we can wrap this up under one of the existing AuthFailure. But again, its not a authFailure in this one. Its a timeout error.
// TODO: Create a Dictionary representing AuthFailure object due to `null` auth token and pass it in body instead of passing `nil`
Copy link
Member

Choose a reason for hiding this comment

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

Agreed to this TODO

Comment on lines +65 to +69
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
ITBInfo()
guard let url = userActivity.webpageURL else {
return false
}
Copy link
Member

Choose a reason for hiding this comment

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

What is this for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Our example app doesn't seem to be correctly configured for universal links, so I was trying to update it to handle things correctly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can take it out if you'd like

@lposen lposen mentioned this pull request Oct 14, 2025
Copy link
Member

@Ayyanchira Ayyanchira left a comment

Choose a reason for hiding this comment

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

LGTM

Base automatically changed from jwt/MOB-10947-task-3-android-retrypolicy-config-at-android-br to jwt/master October 14, 2025 23:26
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]

@lposen lposen merged commit e579386 into jwt/master Oct 14, 2025
8 checks passed
@lposen lposen deleted the jwt/MOB-11032-task-4-ios-bridge-retrypolicy-and-authfailure branch October 14, 2025 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants