我一直在使用以下模块开发一个react-native应用程序:
https://github.com/viestat/react-native-spotify
目前,应用程序打开认证窗口以登录到spotify.我确实得到了成功的回报,但我很困惑,我现在如何摆脱弹出登录的窗口.我知道它应该重定向回我的应用程序,但它只是与logout /我的帐户按钮保持在同一个窗口.
如何在退回的成功消息上关闭此窗口的任何想法?
SpotifyAuth.setClientID('*****','*****', ['streaming', 'playlist-read-private'], (error)=>{
if(error){
console.log(error);
} else {
console.log('success');
}
});
Run Code Online (Sandbox Code Playgroud)
我要开发的React Native(0.38.0版本)应用程序存在问题。我基本上在学习。
我正在从自定义API端点获取JSON。我设法遍历了JSON并输出了一些数据,但是问题是string链接到图像。我不断收到错误:
JSON Value of { robj = "https://example.com/img.jpg" } type NSDictionary Cannot be converted to NSString.
Run Code Online (Sandbox Code Playgroud)
在Google周围有一个侦察员之后,我看不出问题的正面或反面。
有人能指出我正确的方向吗?
var api = {
getData() {
var url = 'https://example.com/api/json/'
return fetch(url).then((res) => res.json())
}
}
class GetCategories extends Component {
constructor(props) {
super(props)
this.state = {
categories: []
}
}
componentWillMount() {
api.getData().then((res) => {
this.setState({
categories: res
})
})
}
render() {
var catLoop =this.state.categories.map(function(obj, index){
var catTitle = '',
catImage = '';
catTitle = obj.title; …Run Code Online (Sandbox Code Playgroud)