Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,13 @@ public class ReactNativeDeviceActivityModule: Module {
try await ac.requestAuthorization(
for: forIndividualOrChild == "child" ? .child : .individual)
} else {
logger.log("⚠️ iOS 16.0 or later is required to request authorization.")
let errorMessage = "iOS 16.0 or later is required to request authorization."
logger.log("⚠️ \(errorMessage)")
throw NSError(
domain: "FamilyControls",
code: 9999,
userInfo: [NSLocalizedDescriptionKey: errorMessage]
)
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/react-native-device-activity/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export async function requestAuthorization(
forIndividualOrChild,
);
} catch (error) {
// seems like we get a promise rejection if the user denies the authorization, but we can still request again
console.error(error);
// Re-throw the error so it can be properly handled by the caller
throw error;
}
}

Expand Down
Loading