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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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;
        }
Exemplo n.º 5
0
 internal Picture(BuddyClient client = null)
     : base(client)
 {
 }
Exemplo n.º 6
0
 public Picture(string id, BuddyClient client = null)
     : base(id, client)
 {
 }
Exemplo n.º 7
0
 public Location(string id= null, BuddyClient client = null)
     : base(id, client)
 {
 }
Exemplo n.º 8
0
 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;
 }
Exemplo n.º 10
0
 public Message(string id, BuddyClient client = null)
     : base(id, client)
 {
 }
Exemplo n.º 11
0
 internal Album(BuddyClient client = null)
     : base(client)
 {
 }
Exemplo n.º 12
0
		public Album(string id, BuddyClient client= null)
			: base(id, client)
		{
		}
Exemplo n.º 13
0
 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;
        }
Exemplo n.º 15
0
 public Checkin(string id, BuddyClient client = null)
     : base(id, client)
 {
 }
Exemplo n.º 16
0
 internal Checkin(BuddyClient client = null)
     : base(client)
 {
 }
Exemplo n.º 17
0
 internal Message(BuddyClient client = null)
     : base(client)
 {
 }
Exemplo n.º 18
0
 internal User(BuddyClient client = null): base(client)
 {
 }
Exemplo n.º 19
0
 public UserListItem(string path, BuddyClient client = null)
     : base(null, client)
 {
     this.path = path;
 }
Exemplo n.º 20
0
 internal UserListItem(BuddyClient client = null)
     : base(client)
 {
 }
Exemplo n.º 21
0
 public Metadata(string id, BuddyClient client = null)
     : base(id, client)
 {
 }
Exemplo n.º 22
0
 internal Location(BuddyClient client = null)
     : base(client)
 {
 }
Exemplo n.º 23
0
 public Notification(string id, BuddyClient client = null)
     : base(id, client)
 {
 }
Exemplo n.º 24
0
 public Picture(string id, string signedUrl, BuddyClient client = null)
     : this(id, client)
 {
     SetValue<string>("signedUrl", signedUrl, checkIsProp: false);
 }
Exemplo n.º 25
0
 internal Notification(BuddyClient client)
     : base(client)
 {
 }
 internal AuthenticatedUser(string id, string accessToken, BuddyClient client)
     : base(id, client)
 {
     this.AccessToken = accessToken;
 }
Exemplo n.º 27
0
 public BuddyAnalyticsEndpoint()
 {
     this.client = new BuddyClient("bbbbbc.mhbbbxjLrKNl", "83585740-AE7A-4F68-828D-5E6A8825A0EE");
 }