在Xamarin.iOS中解密推送通知的最佳方式是什么

在Xamarin.iOS中解密推送通知的最佳方式是什么,ios,encryption,push-notification,xamarin.ios,onesignal,Ios,Encryption,Push Notification,Xamarin.ios,Onesignal,我在应用程序中收到的推送通知消息是加密的,我希望在推送通知横幅中显示内容之前对消息进行解密。该应用程序是使用Xamarin表单构建的,我使用onesignal进行推送通知 我已经创建了一个通知应用程序扩展,并在其中添加了解密消息的代码,但该项目没有编译 public override void DidReceiveNotificationRequest(UNNotificationRequest request, Action<UNNotificationContent> conte

我在应用程序中收到的推送通知消息是加密的,我希望在推送通知横幅中显示内容之前对消息进行解密。该应用程序是使用Xamarin表单构建的,我使用onesignal进行推送通知

我已经创建了一个通知应用程序扩展,并在其中添加了解密消息的代码,但该项目没有编译

public override void DidReceiveNotificationRequest(UNNotificationRequest request, Action<UNNotificationContent> contentHandler)
{
     ContentHandler = contentHandler;
     ReceivedRequest = request;
     BestAttemptContent = (UNMutableNotificationContent)request.Content.MutableCopy();
     var crypto = new CryptoNetCore();
     BestAttemptContent.Subtitle = crypto.DecryptText(BestAttemptContent.Subtitle,crypto.CryptographicKey);
     (OneSignal.Current as OneSignalImplementation).DidReceiveNotificationExtensionRequest(request, BestAttemptContent);
     ContentHandler(BestAttemptContent);
}
public override void DidReceiveNotificationRequest(UNNotificationRequest请求,Action contentHandler)
{
ContentHandler=ContentHandler;
ReceivedRequest=请求;
BestAttemptContent=(UNMutableNotificationContent)request.Content.MutableCopy();
var crypto=new CryptoNetCore();
BestAttemptContent.Subtitle=crypto.DecryptText(BestAttemptContent.Subtitle,crypto.CryptographicKey);
(OneSignal.Current作为OneSignal实现)。DidReceiveNotificationExtensionRequest(请求,BestAttemptContent);
ContentHandler(BestAttemptContent);
}
我收到的错误是错误MT2001:无法链接程序集。原因:处理“TestNotificationServiceExtension,版本=0.0.0.0,区域性=中性,PublicKeyToken=null”(MT2001)(DrTalk.iOS)的引用时出错。

加密服务是在一个共享的.net标准项目中定义的,我在Notification service Extension中引用了该项目。从该方法访问crypto类的最佳方法是什么


请注意,加密密钥不是本地保存的,而是从服务器获取的。

请尝试解决方案,将-v-v-v-v添加到“其他mtouch参数”中在项目中,iOS生成设置将有助于诊断问题。@JackHua MSFT:将-v-v-v-v添加到其他mtouch参数不会给出任何详细的错误报告。您可以按照以下步骤触发问题。请尝试解决方案,将-v-v-v-v添加到“其他mtouch参数”中在项目中,iOS生成设置将有助于诊断问题。@JackHua MSFT:将-v-v-v-v添加到其他mtouch参数不会给出任何详细的错误报告。您可以按照以下步骤触发问题。