About Account Information

About Account Information



To retrieve the information about the user’s account, call fetchAccountInfoWithCompletionHandler: method.

  1. If you have not done that already, add Cloud SDK framework for IOS to an existing or a new IOS application.
  2. Include VerizonCloudAPI.framework header file in you class: #import <VerizonCloudAPI/VerizonCloudAPI.h>
  3. Initalize the PCAPISDK object and call the fetchAccountInfoWithCompletionHandler: method.
  4. Perform the fetchAccountInfoWithCompletionHandler: API call using the code sample in this example.
  5. Obtain the result from the completion block.
  6. If the session is no longer valid:
    1. Call the logout API which the removes the access token stored in the keychain.
    2. Call authenticate:fromViewController:withCompletionHandler: API to get a new access token.


Code Sample

      @try {
        [[PCAPISDK sharedInstance] fetchAccountInfoWithCompletionHandler:^(PCAccountInfo *accountInfo, PCAPIQueryResponse *response) {
            switch (response.urlResponse.statusCode) {
                case PCAPIResponseCodeOK: {
                    NSLog(@"Account ID: %@", accountInfo.ID);
                    NSLog(@"Account alias: %@", accountInfo.alias);
                    NSLog(@"Total quota space available in account: %lld", accountInfo.quota);
                    NSLog(@"Total quota space used in account: %lld", accountInfo.quotaUsed);
                case PCAPIResponseCodeUnauthorized:
                    NSLog(@"Session is no longer valid");
                case PCAPIResponseCodeServiceUnavailable:
                    NSLog(@"Server Unavailable");
                    NSLog(@"Fetch account info API failed");
    @catch (NSException *exception) {
        NSLog(@"Catching %@ reason %@", [exception name], [exception reason]);

Copyright © 2015-2017, Verizon and/or its Licensors. All rights reserved.