internal static BuddyServiceClientBase CreateServiceClient(BuddySDK.BuddyClient client, string serviceRoot, string appID, string sharedSecret) { var type = typeof(BuddyServiceClientHttp); string typeName = null; try { typeName = PlatformAccess.Current.GetConfigSetting("BuddyServiceClientType"); } catch (NotImplementedException) { // platform access doesn't provide config settings } if (typeName != null) { type = Type.GetType(typeName, true); } if (!typeof(BuddyServiceClientBase).IsAssignableFrom(type)) { throw new ArgumentException(type.FullName + " is not a BuddyServiceClientBase implementor."); } var bsc = (BuddyServiceClientBase)Activator.CreateInstance(type, serviceRoot, appID, sharedSecret); bsc.Client = client; return(bsc); }
public static IBuddyClient Init(string appId, string appKey, BuddyOptions options = null) { if (options == null) { options = new BuddyOptions(); } if (_currentClientKey != null && !options.Flags.HasFlag(BuddyClientFlags.AllowReinitialize)) { throw new InvalidOperationException("Already initialized."); } CurrentInstance = new BuddyClient(appId, appKey, options); return(CurrentInstance); }
protected async Task <bool> OnServiceException(BuddyClient client, BuddyServiceException buddyException) { if (buddyException is BuddyUnauthorizedException) { client.OnAuthorizationFailure((BuddyUnauthorizedException)buddyException); return(false); } else if (buddyException is BuddyNoInternetException) { await client.OnConnectivityChanged(ConnectivityLevel.None); return(false); } bool result = false; if (ServiceException != null) { var args = new ServiceExceptionEventArgs(buddyException); ServiceException(this, args); result = args.ShouldThrow; } return(result); }
public static void Init(string appId, string appKey, BuddyClientFlags flags = PlatformAccess.DefaultFlags) { if (_creds != null && !flags.HasFlag(BuddyClientFlags.AllowReinitialize)) { throw new InvalidOperationException("Already initialized."); } _creds = new Tuple<string, string, BuddyClientFlags>(appId, appKey, flags); _client = null; }
internal Picture(BuddyClient client = null) : base(client) { }
public Picture(string id, BuddyClient client = null) : base(id, client) { }
public Location(string id= null, BuddyClient client = null) : base(id, client) { }
public User(string id, BuddyClient client = null) : base(id, client) { }
internal SocialAuthenticatedUser(string id, string accessToken, bool isNew, BuddyClient client = null) : base(id, accessToken, client) { IsNew = isNew; }
public Message(string id, BuddyClient client = null) : base(id, client) { }
internal Album(BuddyClient client = null) : base(client) { }
public Album(string id, BuddyClient client= null) : base(id, client) { }
public AlbumItem(string path, BuddyClient client = null) : base(null, client) { this.path = path; }
protected BuddyMetadataBase(string id, BuddyClient client = null) { this._metadataId = id; this._client = client; }
public Checkin(string id, BuddyClient client = null) : base(id, client) { }
internal Checkin(BuddyClient client = null) : base(client) { }
internal Message(BuddyClient client = null) : base(client) { }
internal User(BuddyClient client = null): base(client) { }
public UserListItem(string path, BuddyClient client = null) : base(null, client) { this.path = path; }
internal UserListItem(BuddyClient client = null) : base(client) { }
public Metadata(string id, BuddyClient client = null) : base(id, client) { }
internal Location(BuddyClient client = null) : base(client) { }
public Notification(string id, BuddyClient client = null) : base(id, client) { }
public Picture(string id, string signedUrl, BuddyClient client = null) : this(id, client) { SetValue<string>("signedUrl", signedUrl, checkIsProp: false); }
internal Notification(BuddyClient client) : base(client) { }
internal AuthenticatedUser(string id, string accessToken, BuddyClient client) : base(id, client) { this.AccessToken = accessToken; }
public BuddyAnalyticsEndpoint() { this.client = new BuddyClient("bbbbbc.mhbbbxjLrKNl", "83585740-AE7A-4F68-828D-5E6A8825A0EE"); }