Пример #1
0
        public ApiContainer(string appKey, string appSecret, string url = SdkManager.DEFAULT_URL)
        {
            var passportBag = SdkManager.GetPassportBag(appKey);
            if (passportBag == null || passportBag.Passport == null)
            {
                SdkManager.ApplyPassport(appKey, appSecret, url);
            }

            Passport = SdkManager.GetPassportBag(appKey).Passport;//执行SdkManager.ApplyPassport后,PassportCollection[appKey]必定存在

            FriendApi = new FriendApi(Passport);
            MessageApi = new MessageApi(Passport);
            MediaApi = new MediaApi(Passport);
            MemberApi = new MarketingToolApi.MemberApi(Passport);
        }
Пример #2
0
        public ApiContainer(string appKey, string appSecret, string url = SdkManager.DEFAULT_URL)
        {
            var passportBag = SdkManager.GetPassportBag(appKey);

            if (passportBag == null || passportBag.Passport == null)
            {
                SdkManager.ApplyPassport(appKey, appSecret, url);
            }

            Passport = SdkManager.GetPassportBag(appKey).Passport;//执行SdkManager.ApplyPassport后,PassportCollection[appKey]必定存在

            FriendApi  = new FriendApi(Passport);
            MessageApi = new MessageApi(Passport);
            MediaApi   = new MediaApi(Passport);
            MemberApi  = new MarketingToolApi.MemberApi(Passport);
        }