xamarin/Xamarin.Forms

DependencyService does not gets registered if called by xamarin.forms project before registering

オープン

#2,445 opened on 2018/04/12

 (5 件のコメント) (0 件のリアクション) (0 人の担当者)C# (1,926 件のフォーク)batch import
e/5 :clock5:help wantedt/bug :bug:up-for-grabs

Repository metrics

Stars
 (5,644 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

Description

When DependencyService is registered before PLC project calls for the method, it works well. However if it is called before the native project registers the method, Register method in Dependency service never works again

Steps to Reproduce

Please find a sample project in the below link:

https://github.com/rags217/DSTest

  1. click set dependency1 button -> message displayed: dependency1 is set
  2. click call dependency2 button -> message displayed: dependency1 is called
  3. That works fine
  4. now try in the reverse order for second dependency
  5. click call dependency2 button -> message displayed: dependency2 is null
  6. click set dependency1 button -> message displayed: dependency2 is set
  7. click call dependency2 button AGAIN-> message displayed: dependency2 is null

Expected Behavior

in step 7 message should be dependency2 is set

Actual Behavior

in step 7 message should be dependency2 is null

Basic Information

Version with issue: 2.5.0.280555 Last known good version: N/A IDE: Xamarin Studio for Mac Platform Target Frameworks: Android: 8.0 Android Support Library Version: N/A Nuget Packages: Affected Devices: Samsung galaxy, LG variants

Screenshots

Reproduction Link

https://github.com/rags217/DSTest

コントリビューターガイド