Skip to content

Commit 38ac623

Browse files
committed
Added title and message to confirm dialog.
1 parent 1d272af commit 38ac623

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

Plugins/iOS/IOSBridge.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ public static class Alert
5959
{
6060

6161
[DllImport("__Internal")]
62-
private static extern void IOSUIAlertController();
62+
private static extern void IOSUIAlertController(string title, string message);
6363

64-
public static void IOSUIAlertController(Action okCallback, Action cancelCallback)
64+
public static void IOSUIAlertController(string title, string message, Action okCallback, Action cancelCallback)
6565
{
6666

6767
var okGameObject = new GameObject("IOSBridgeEvents - UIAlertController - OK");
@@ -86,14 +86,14 @@ public static void IOSUIAlertController(Action okCallback, Action cancelCallback
8686

8787
};
8888

89-
IOSUIAlertController();
89+
IOSUIAlertController(title, message);
9090

9191
}
9292

93-
public static void IOSUIAlertController(Action okCallback)
93+
public static void IOSUIAlertController(string title, string message, Action okCallback)
9494
{
9595

96-
IOSUIAlertController(okCallback, () => {});
96+
IOSUIAlertController(title, message, okCallback, () => {});
9797

9898
}
9999

Plugins/iOS/IOSBridge.mm

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,13 @@ bool IOSUIAccessibilityIsSpeakSelectionEnabled() {
125125
return UIAccessibilityIsSpeakSelectionEnabled();
126126
}
127127

128-
void IOSUIAlertController() {
128+
void IOSUIAlertController(const char* title, const char* message) {
129129

130-
UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"My Alert"
131-
message:@"This is an alert."
130+
NSString* titleString = [NSString stringWithUTF8String: title];
131+
NSString* messageString = [NSString stringWithUTF8String: message];
132+
133+
UIAlertController* alert = [UIAlertController alertControllerWithTitle:titleString
134+
message:messageString
132135
preferredStyle:UIAlertControllerStyleAlert];
133136

134137
UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault

0 commit comments

Comments
 (0)