{"action":"created","issue":{"url":"https://api.github.com/repos/BranchMetrics/Xamarin-Deferred-Deep-Linking-SDK/issues/27","repository_url":"https://api.github.com/repos/BranchMetrics/Xamarin-Deferred-Deep-Linking-SDK","labels_url":"https://api.github.com/repos/BranchMetrics/Xamarin-Deferred-Deep-Linking-SDK/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/BranchMetrics/Xamarin-Deferred-Deep-Linking-SDK/issues/27/comments","events_url":"https://api.github.com/repos/BranchMetrics/Xamarin-Deferred-Deep-Linking-SDK/issues/27/events","html_url":"https://github.com/BranchMetrics/Xamarin-Deferred-Deep-Linking-SDK/issues/27","id":153768858,"number":27,"title":"Xamarin.Android SDK - cannot initialize with an Application context","user":{"login":"wis-jellis","id":19266448,"avatar_url":"https://avatars.githubusercontent.com/u/19266448?v=3","gravatar_id":"","url":"https://api.github.com/users/wis-jellis","html_url":"https://github.com/wis-jellis","followers_url":"https://api.github.com/users/wis-jellis/followers","following_url":"https://api.github.com/users/wis-jellis/following{/other_user}","gists_url":"https://api.github.com/users/wis-jellis/gists{/gist_id}","starred_url":"https://api.github.com/users/wis-jellis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wis-jellis/subscriptions","organizations_url":"https://api.github.com/users/wis-jellis/orgs","repos_url":"https://api.github.com/users/wis-jellis/repos","events_url":"https://api.github.com/users/wis-jellis/events{/privacy}","received_events_url":"https://api.github.com/users/wis-jellis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-09T12:50:08Z","updated_at":"2016-05-11T07:19:13Z","closed_at":null,"body":"Hi, in the doc here:\r\nhttps://dev.branch.io/getting-started/sdk-integration-guide/guide/xamarin/#start-a-branch-session\r\n\r\nsection 4 states: Add calls to the OnCreate and OnNewIntent methods of either your Application class or the first Activity you start\r\n\r\nI'm not using Xamarin.Forms, I'm using Xamarin.Android, but same documentation seems to apply here:\r\nhttps://dev.branch.io/getting-started/sdk-integration-guide/advanced/xamarin/#initialization-for-non-forms-apps\r\n\r\nMy preference is to use initialization in my Application class - to handle various scenarios in our app that may not run through particular Activities (like sharing from a pending intent of a push notification display).\r\n\r\nUnfortunately, it seems this is not really supported, based on code here:\r\nhttps://github.com/BranchMetrics/Xamarin-Deferred-Deep-Linking-SDK/blob/master/Branch-Xamarin-SDK.Droid/BranchAndroid.cs\r\n\r\nline 69:((Activity)context).Application.RegisterActivityLifecycleCallbacks (instance.lifeCycleHandler);\r\n\r\nit is assuming that the context passed in is always an Activity and casting to that.  Can this be adjusted to take an Application OR an Activity? and register the lifecycle callbacks appropritately? (i.e. Application.RegisterActivityLifecycleCallbacks in my case)?\r\n\r\nThanks\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/BranchMetrics/Xamarin-Deferred-Deep-Linking-SDK/issues/comments/218381275","html_url":"https://github.com/BranchMetrics/Xamarin-Deferred-Deep-Linking-SDK/issues/27#issuecomment-218381275","issue_url":"https://api.github.com/repos/BranchMetrics/Xamarin-Deferred-Deep-Linking-SDK/issues/27","id":218381275,"user":{"login":"antonargunov","id":2960222,"avatar_url":"https://avatars.githubusercontent.com/u/2960222?v=3","gravatar_id":"","url":"https://api.github.com/users/antonargunov","html_url":"https://github.com/antonargunov","followers_url":"https://api.github.com/users/antonargunov/followers","following_url":"https://api.github.com/users/antonargunov/following{/other_user}","gists_url":"https://api.github.com/users/antonargunov/gists{/gist_id}","starred_url":"https://api.github.com/users/antonargunov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antonargunov/subscriptions","organizations_url":"https://api.github.com/users/antonargunov/orgs","repos_url":"https://api.github.com/users/antonargunov/repos","events_url":"https://api.github.com/users/antonargunov/events{/privacy}","received_events_url":"https://api.github.com/users/antonargunov/received_events","type":"User","site_admin":false},"created_at":"2016-05-11T07:19:13Z","updated_at":"2016-05-11T07:19:13Z","body":"Hello @wis-jellis,\r\nI will add a method with parameter Application.\r\n\r\nBranch need to know ApplicationContext and I will receive it from Application, or will you set it by yourself? need I add one more parameter to set ApplicationContext?"}}