Hi guys m new to unity development and i want to add 3 SDKs to integrate in UNITY
FACEBOOK SDK
Countly
Adjust
and wanted to make a single SDK so that it can be used in future any idea how to do this?
Hi guys m new to unity development and i want to add 3 SDKs to integrate in UNITY
FACEBOOK SDK
Countly
Adjust
and wanted to make a single SDK so that it can be used in future any idea how to do this?
I don't know exactly what functionality you want to use from those modules, but if they all pretty much do the same, you might define a common interface and have 3 adapters that make your modules fit to that interface.
interface ITrackingSdk
{
void StartSession(string[] identifiers);
...
}
class FacebookTrackingSdk : ITrackingSdk
{
private YourFacebookModule facebook;
public static bool IsSupported { get { return true; } }
public void StartSession(string[] identifiers)
{
facebook.InitializeBla(...);
}
...
}
class CountlyTrackingSdk : ITrackingSdk { ... }
class AdjustTrackingSdk : ITrackingSdk { ... }
Then you have a factory that can create instances of your ITrackingSdk implementations, depending on the support on your current platform.
class TrackingSdkFactory
{
public ICollection<ITrackingSdk> CreateSupportedTrackingSdks()
{
List<ITrackingSdk> sdks = new List...
if (FacebookTrackingSdk.IsSupported)
sdks.Add(new FacebookTrackingSdk());
if (CountlyTrackingSdk.IsSupported)
sdks.Add(new CountlyTrackingSdk());
if (AdjustTrackingSdk.IsSupported)
sdks.Add(new AdjustTrackingSdk());
return sdks;
}
}
And finally you might have some kind of Controller, that on start asks the Factory to provide all supported tracking Sdks, and then manages them.
And if people tell you to stick your goals lower, simply ignore them. Aim high and learn what you need to get there.