Using AFIncrementalStore with an Auth token

徘徊边缘 提交于 2019-12-03 21:20:29

All you have to do with the case above to alter it to correctly use an access token is add parameters to the request instead of passing nil.

To build the parameters simply make an NSDictionary with the keys and values you need. For example in some of my App.net code I have this

NSDictionary *params = @{@"access_token": token};

Using the new compiler directives this builds an NSDictionary with a single key (in this case 'access_token') with the value in the NSString token.

After you have this just make your request something like:

[self requestWithMethod:@"GET" path:@"stream/0/posts/stream" parameters:params];

To pass the parameters in the request.

Let me know if this isn't clear enough!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!