0

我的代碼推送正在模擬器上工作,但是當我在設備上運行相同的應用程序時,它顯示我更新對話框,但是當我按下安裝時什麼也沒有發生。代碼推送不更新iOS設備上的應用程序

class MyApp extends React.Component { 
    constructor() { 
     super(); 
     this.state = { 
      logs: [] 
     } 
    } 
    codePushStatusDidChange(status) { 
     let msg = ''; 
     switch(status) { 
      case codePushComponent.SyncStatus.CHECKING_FOR_UPDATE: 
       msg = ("Checking for updates."); 
       break; 
      case codePushComponent.SyncStatus.DOWNLOADING_PACKAGE: 
       msg = ("Downloading package."); 
       break; 
      case codePushComponent.SyncStatus.INSTALLING_UPDATE: 
       msg = ("Installing update."); 
       break; 
      case codePushComponent.SyncStatus.UP_TO_DATE: 
       msg = ("Up-to-date."); 
       break; 
      case codePushComponent.SyncStatus.UPDATE_INSTALLED: 
       msg = ("Update installed."); 
       break; 
     } 
    } 
    codePushDownloadDidProgress(progress) { 
     console.log(progress.receivedBytes + " of " + progress.totalBytes + " received."); 
    } 
    update() { 
     codePushComponent.sync({ 
      updateDialog: true, 
      installMode: codePushComponent.InstallMode.IMMEDIATE 
     },() => this.codePushStatusDidChange,() => this.codePushDownloadDidProgress); 
    } 

    render(){ 
     return (
      <View style={styles.container}> 
       <Text style={styles.welcome}> 
        Welcome 
       </Text> 
       <Text style={styles.instructions}> 
        Update version 1.0 
       </Text> 
       <Button title="Update" onPress={() => this.update()} /> 
      </View> 
     ) 
    } 
} 
export default (MyApp) 

附加資料

  • 反應本機代碼的推版本: 4.1.0-β
  • 反應本地版本: 16.0.0-alpha.12
  • iOS /安卓/ Windows版本: IOS 10.3
  • 這是否在調試版本或發行版本上重現? Release
  • Release這是在模擬器上還是在物理設備上重現? 物理設備僅

回答

相關問題