在WP8中实现parse.com推送通知时出错

时间:2014-10-06 18:31:41

标签: windows-phone-8 push-notification parse-platform

关注parse.com quickstart guide for an existing WP8项目并且它无效。

代码:

public App()
    {
        // Global handler for uncaught exceptions. 
        UnhandledException += Application_UnhandledException;

        // Standard Silverlight initialization
        InitializeComponent();

        // Phone-specific initialization
        InitializePhoneApplication();

        ParseClient.Initialize("ParseAppId", "ParseDotNetKey");
        this.Startup += async (sender, args) =>
        {
            // This optional line tracks statistics around app opens, including push effectiveness:
            ParseAnalytics.TrackAppOpens(RootFrame);

            // By convention, the empty string is considered a "Broadcast" channel
            // Note that we had to add "async" to the definition to use the await keyword
            await ParsePush.SubscribeAsync("");
        };
    }

错误:

$exception  {System.Reflection.TargetInvocationException: Exception has been thrown by the        target of an invocation. ---> System.NotImplementedException: The method or operation is not implemented.  
at Windows.Storage.ApplicationData.get_LocalSettings()  
at Parse.PlatformHooks.SettingsWrapper..ctor()  
at Parse.PlatformHooks.SettingsWrapper.get_Wrapper()  
at Parse.PlatformHooks.get_ApplicationSettings()  
at Parse.ParseClient.get_ApplicationSettings()  
at Parse.ParseClient.get_InstallationId()  
at Parse.ParseClient.Initialize(String applicationId, String dotnetKey)  
at MyApp.App..ctor()  
--- End of inner exception stack trace ---  
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)  
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)  
at MS.Internal.TypeProxy.<>c__DisplayClass32.<GetCreateObjectDelegate>b__2c()  
at MS.Internal.TypeProxy.CreateInstance(UInt32 customTypeId)  
at MS.Internal.FrameworkCallbacks.CreateKnownObject(IntPtr nativeRootPeer, UInt32 customTypeId, String initializationString, IntPtr& nativePeer, UInt32 isCreatedByParser)}   System.Exception {System.Reflection.TargetInvocationException}  

不知道这里发生了什么 任何帮助表示赞赏。

1 个答案:

答案 0 :(得分:1)

我有完全相同的错误,看起来Parse在最新版本的Parse.Phone.dll中使用了一些专为Windows而不是Windows Phone设计的类。我想出的唯一解决方案是使用旧版本的WP解析(在我的情况下为1.2.16)。希望你能发现它有用