Hi.
We are currently building a system to send push notifications using Firebase.
In order to send push notifications, we need to install the Firebase Admin SDK and get the server connection key information, and we are having trouble finding a way to include that information.
Currently, we use it by bundling it as an embedded resource, getting the directory path to the resource if necessary, and passing the path to the file stream.
I hope there are no security issues with this method, but considering decompilation, I don't feel comfortable with it.
How do you implement the storage of this kind of sensitive information in your applications?
Smart way or not, it's welcome.
Thanks for your help!
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hello.
My development environment is as follows.
iPhone 7 - Ver iOS14.5.1
iPad 8th- Ver iPadOS14.5.1
Microsoft Visual Studio Enterprise 2019 - Ver 16.9.5
Xamarin - Ver 16.9.000.292
Xamarin.iOS and Xamarin.Mac.SDK - Ver 14.16.0.5
https://support.apple.com/en-us/HT208386
Using the above article as a reference, I linked my iPhone and iPad with an Apple ID and sent SMS from an iPad application created with Xamarin, but the country code I specified as the recipient was automatically changed to a different number than the one I wanted.
The source code is as follows.
ISMS.cs
class CSMSiOS : ISMS
{
public void SendSMS(string Dial,string WideDial)
{
if(!MFMessageComposeViewController.CanSendText) //SMS function available
{
Console.WriteLine("SMS function not available");
return;
}
MFMessageComposeViewController smsController = new MFMessageComposeViewController();
if (!string.IsNullOrWhiteSpace(Dial))
{
string[] recipients = Dial.Split(';');
if (recipients.Length > 0)
smsController.Recipients = recipients;
}
smsController.Body = WideDial+ "Message";
smsController.SetEditing(false, true);
PresentMessageComposeViewController(smsController);
Console.WriteLine("SMS sending page");
}
private void PresentMessageComposeViewController(MFMessageComposeViewController smsController)
{
EventHandler<MFMessageComposeResultEventArgs> handler = null;
handler = (sender, args) =>
{
smsController.Finished -= handler;
if (!(sender is UIViewController uiViewController))
{
throw new ArgumentException("sender");
}
uiViewController.DismissViewController(true, () => { });
};
smsController.Finished += handler;
ClsSMSPageView.PresentUsingRootViewController(smsController);
}
}
ClsSMSPageView.Xaml.cs
static class ClsSMSPageView
{
public static void PresentUsingRootViewController(this UIViewController controller)
{
if (controller == null)
throw new ArgumentNullException(nameof(controller));
var visibleViewController = GetVisibleViewController(null);
if (visibleViewController == null)
{
throw new InvalidOperationException("Could not find a visible UIViewController on the Window hierarchy");
}
visibleViewController.PresentViewController(controller, true, () => { });
}
private static UIViewController GetVisibleViewController(UIViewController controller)
{
UIViewController viewController = null;
UIWindow window = UIApplication.SharedApplication.KeyWindow;
if (window == null)
throw new InvalidOperationException("There's no current active window");
if (window.WindowLevel == UIWindowLevel.Normal)
viewController = window.RootViewController;
if (viewController == null)
{
window = UIApplication.SharedApplication.Windows.OrderByDescending(w => w.WindowLevel)
.FirstOrDefault(w => w.RootViewController != null && w.WindowLevel == UIWindowLevel.Normal);
if (window == null)
throw new InvalidOperationException("Could not find current view controller");
else
viewController = window.RootViewController;
}
while (viewController.PresentedViewController != null)
viewController = viewController.PresentedViewController;
return viewController;
}
}
For example, if you specify [8081234567], [+0] would normally be specified as the country code and it would be [+0 8081234567], but somehow [+44] would be specified as the country code and it would be [+44 8081234567].
I welcome any and all opinions and advice you may have.
Thank you very much.
Hi.
My development environment is as follows.
-
iPad - Ver iPadOS14.5.1
Microsoft Visual Studio Enterprise 2019 - Ver 16.9.5
Xamarin - Ver 16.9.000.292
Xamarin.iOS and Xamarin.Mac.SDK - Ver 14.16.0.5
XCode Ver 12.5
-
Since the update, I can't debug anymore.
Any help would be greatly appreciated.
Thank you for your help.