Ejemplo n.º 1
0
        // Nebulaサービス初期化
        public static void InitNebula(NbService service = null, int no = 0)
        {
            try
            {
                service = service ?? NbService.Singleton;
            }
            catch (NullReferenceException)
            {
                // CommonITでNbServiceをDisposeしているので、
                // フェールセーフ処理を入れておく
                service = NbService.GetInstance();
            }

            service.EndpointUrl = TestConfig.NebulaEndpointUrl;
            service.DisableOffline();

            // for MultiTenant

            /*
             * if (1 == no)
             * {
             *  service.TenantId = TenantId2;
             *  service.AppId = AppId2;
             *  service.AppKey = AppKey2;
             * }
             * else
             * {
             */
            service.TenantId = TestConfig.TenantId;
            service.AppId    = TestConfig.AppId;
            service.AppKey   = TestConfig.AppKey;
            //}
        }
Ejemplo n.º 2
0
        public static void Init()
        {
            var service = NbService.GetInstance();

            service.TenantId    = TenantId;
            service.AppId       = AppId;
            service.AppKey      = AppKey;
            service.EndpointUrl = EndpointUri;
        }
        public TodoPage()
        {
            InitializeComponent();

            var service = NbService.GetInstance();

            _viewModel  = new TodoViewModel();
            DataContext = _viewModel;

            _viewModel.Reload();
        }
        public MainWindow()
        {
            InitializeComponent();

            // Initialize Nebula
            var service = NbService.GetInstance();

            service.TenantId    = "";
            service.AppId       = "";
            service.AppKey      = "";
            service.EndpointUrl = "https://baas.example.com/api";
        }
        public MainWindow()
        {
            InitializeComponent();

            // Initialize Nebula
            var service = NbService.GetInstance();

            service.TenantId    = "";
            service.AppId       = "";
            service.AppKey      = "";
            service.EndpointUrl = "https://baas.example.com/api";

            _viewModel  = new TodoViewModel();
            DataContext = _viewModel;

            _viewModel.Reload();
        }
Ejemplo n.º 6
0
        // ログイン操作部
        private async void login(String token)
        {
            // NbService の生成
            var service = NbService.GetInstance();

            // テナントID
            service.TenantId = TenantId;
            // アプリケーションID
            service.AppId = AppId;
            // アプリケーションキー
            service.AppKey = AppKey;
            // エンドポイントURI
            service.EndpointUrl = EndpointUrl;

            var param = new NbUser.LoginParam()
            {
                Token = token
            };

            try
            {
                var ret = await NbUser.LoginAsync(param);

                Console.WriteLine("UserID = " + ret.UserId);
                Console.WriteLine("Email = " + ret.Email);
                Console.WriteLine("UserName = "******"CreatedAt = " + ret.CreatedAt);
                Console.WriteLine("UpdatedAt = " + ret.UpdatedAt);
                Console.WriteLine("Options = " + ret.Options.ToString());
                Console.WriteLine("Groups = " + "[" + String.Join(", ", ret.Groups) + "]");
            }
            catch (Exception ex)
            {
                Console.WriteLine("login : login error = " + ex.ToString());
            }
        }
Ejemplo n.º 7
0
        public void TestConstructorWithServiceNormal()
        {
            NbService.EnableMultiTenant(true);
            var service = NbService.GetInstance();

            // Main
            var installation = new NbPushInstallation(service);

            // Assert
            Assert.AreEqual(service, installation.Service);
            Assert.IsNull(installation.AllowedSenders);
            Assert.AreEqual(installation.AppVersionCode, 0);
            Assert.IsNull(installation.AppVersionString);
            Assert.IsNull(installation.Channels);
            Assert.IsNull(installation.DeviceToken);
            Assert.IsNull(installation.InstallationId);
            Assert.IsNull(installation.Options);
            Assert.IsNull(installation.OsType);
            Assert.IsNull(installation.OsVersion);
            Assert.IsNull(installation.Owner);
            Assert.IsNull(installation.PushType);

            NbService.EnableMultiTenant(false);
        }