Biapost CMS IOS SDK use

Source: Internet
Author: User

Using the SDK in 1.Xcode

Add LIBBIAPOST.A to project in a file that uses the Biapost SDK:

#import "BiaPost.h"

Then register the configuration parameters. Configuration parameters include:

kBiapostApi:API地址

kBiapostAppKey:Biapost CMS后台申请的App Key

kBiapostAppSecret:Biapost CMS后台申请的App Secret

kBiapostRequestOutput:接口输出方式,可以是XML/JSON,默认JSON

To register the configuration parameter code:

[BiaPostregisterParams:@“http://demo.com/api.php” forKey:kBiapostApi];

[BiaPostregisterParams:@“xxxxx” forKey: kBiapostAppKey];

[BiaPostregisterParams:@“xxxxx” forKey: kBiapostAppSecret];

[BiaPostregisterParams:@“json” forKey: kBiapostRequestOutput];

2.IOS SDK API Detailed Access section

+ (void)getColumns:(NSString *)pid

success:(void (^)(NSString* response))success

"Failure: (void (^) (nserror *error)) failure;"

    • PID: Column list, if get the first level column PID is nil;
    • SUCCESS: Get column Information success callback function (return to column protocol data);
    • Failure: callback function for network connection failure;
Get a list of articles

+ (void)getArticles:(BPArticleFilter *)articleFilter

success:(void (^)(NSString* response))success

failure:(void (^)(NSError *error))failure;

    • Bparticlefilter: Selector: Success: Get column Information success callback function (return to column protocol data); failure: callback function for network connection failure;
    • The article List selector Bparticlefilter contains: CID: Column ID, access to the column under the article; PG: page number, pages to get articles; start: Article release time, according to the time interval to obtain the article;
    • End: Article release time, according to the time interval to obtain the article;
Get article details

+ (void)getArticleDetail:(NSString *)aid

success:(void (^)(NSString* response))success

failure:(void (^)(NSError *error))failure;

    • Aid: Article ID
    • SUCCESS: Get column Information success callback function (return to column protocol data);
    • Failure: callback function for network connection failure;
Biapost CMS Android SDK use 1. Using the Android SDK

Add Biapostsdk.jar to Project

Add the following permissions in Androidmanifest.xml:

<uses-sdk android:minSdkVersion=“8” android:targetSdkVersion=“18”/>

<uses-permissionandroid:name=“android.permission.ACCESS_NETWORK_STATE”/>

<uses-permissionandroid:name=“android.permission.ACCESS_WIFI_STATE”/>

<uses-permissionandroid:name=“android.permission.INTERNET”/>

Then initialize the Httputil class with the following code:

New Httputil (context). init (key, Secret,url);

    • Parameter context refers to context;
    • Parameter key refers to App_key;
    • Parameter secret refers to App_secret;
    • The parameter URL refers to the server domain name;
2. Android SDK API detailed Access section

HttpUtil.getDirList(AjaxCallBack<String> call);Get the top-level directory list

Call: callback function for data request operation;

HttpUtil.getDirList(String id, AjaxCallBack<String> call);Gets the subdirectory under the specified parent ID

Get a list of articles

HttpUtil .getArticleList(String id,int page, AjaxCallBack<String> call);Get list of all articles in the specified directory

HttpUtil.getArticleList(int page, AjaxCallBack<String> call);Gets a list of all articles.

Get article details

Httputil.getarticledetail (String ID, ajaxcallback<string> call);

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.