Reputation: 41
I use Xamarin Studio and work on iOS Dependency Services
Here I have tried to resolve the runtime issue in case of getting the object through dependency services. We have tried the same in sample projects as below:
1) Created a PCL project and kept the interfaces there. Using Xamarin.Forms ver 1.2.2.6243.
2) Created an iOS class library (using classic API's) which has the implementation of above interface.(references added for above)
3) Created an iOS project which is starting point and it has invoked the Dependency Service method to get the object of implemented class. (references added for both of above)
4) Tried to get the object of above class and call some interface methods implemented in iOS library project.
Results : I am getting runtime issue as Object returned every time by dependency services was null and not able to call any API’s implemented in iOS library.
Please suggest if we are missing any thing or done some thing wrong here.
Upvotes: 2
Views: 1589
Reputation: 5008
[assembly: Xamarin.Forms.Dependency(typeof (SQLite_iOS))]
namespace DataBinding.iOS ...
Upvotes: 2