使用Azure mobile service進行資料非同步更新

Azure設定步驟

  1. Azure 加入Mobile APP服務
  2. 點選該服務的資料庫連線設定
  3. 選擇已租用的SQL Database 或 Storage,並建立之
  4. 點選Easy Table後,啟用該Service之Backend Service
  5. 新增資料表,並確認存取權限方式

程式代碼步驟

  1. 用方案方式安裝Microsoft.Azure.Mobile.Client元件 in nuget
  2. Droid & iOS 要各別在環境設定註冊Moible Azure Service

注意事項

  1. 在pull時,如果要下條件,記得queryid要唯一。系統會以此id做為建增式更新的要值 (ref)
await todoTable.PullAsync("todoItems" + userid, syncTable.Where(u => u.UserId == userid));

參考範例: https://github.com/vulcanlee/Xamarin.Forms.StepByStep/tree/master/DoggyLab_Xamarin_Forms%20-%20GCM/DoggyLab https://github.com/XpiritBV/dev-days-labs/tree/master/Demos/app-tasks/DevDaysTasks/Services https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-dotnet-how-to-use-client-library/ 加入驗證 https://github.com/jamesmontemagno/app-coffeecups

results matching ""

    No results matching ""