Upgrade to Pro — share decks privately, control downloads, hide ads and more …

NCMB SDK 各プラットフォームの違いを探る / ncmb sdk

NCMB SDK 各プラットフォームの違いを探る / ncmb sdk

2017年2月7日に開催されたNCMB-UG rebuildで発表した資料です。

KOYAMA Tetsuji

February 07, 2017
Tweet

More Decks by KOYAMA Tetsuji

Other Decks in Programming

Transcript

  1. ࢲ͸୭ • খࢁ఩ࢤ (koyhoge) • 2015೥5݄ΑΓNCMBΤόϯδΣϦετ • http://koyhogetech.hatenablog.com/entry/20150507/ ncmb •

    ೔ຊUNIXϢʔβձɺ೔ຊPostgreSQLϢʔβձɺ೔ຊPHP ϢʔβձʹؔΘΔ • NCMB Android SDK v2 ͷॳظ։ൃʹࢀՃ
  2. ॳظԽ J04 "OESPJE • iOS • Android [NCMB setApplicationKey:@"API_KEY", clientKey:@"CLIENT_KEY"];

    public class MainActivity extends AppComaptActivity { @override protected void onCreate(Bundle savedInstanceState) { // <省略> NCMB.initialize(this, "API_KEY", "CLIENT_KEY"); }
  3. ॳظԽ +BWB4DSJQU 6OJUZ • JavaScript • Unity • ॳظԽ͸SDK಺ͰࣗಈͰߦΘΕΔɻAPP_KEY, CLIENT_KEY

    ͸GUIઃఆύωϧNCMBSettingsʹ ొ࿥ɻ var NCMB = NCMB || require("./lib/ncmb"); var ncmb = new NCMB("API_KEY", "CLIENT_KEY");
  4. σʔλετΞ J04 NCMBObject *obj = [NCMBObject objectWithClassName:@“MyClass”]; [obj setObject:@"value" forKey:@"keyname"];

    [obj saveInBackgroundWithBlock:^(NSError *error) { if (error) { // 失敗処理 } else { // 成功処理 } }];
  5. σʔλετΞ "OESPJE NCMBObject obj = new NCMBObject("MyClass"); obj.put("keyname", "value"); obj.saveInBackground(new

    DoneCallback() { @override public void done(NCMBException e) { if (e != null) { // 失敗処理 } else { // 成功処理 } } });
  6. σʔλετΞ +BWB4DSJQU var MyClass = ncmb.DataStore("MyClass"); var obj = new

    MyClass({keyname: "value"}); obj.save() .then(function(result) { // 成功処理 }) .catch (function(err) { // 失敗処理 });
  7. σʔλετΞ 6OJUZ NCMBObject obj = new NCMBObject("MyClass"); obj.Add("keyname", "value"); obj.SaveAsync

    ((NCMBException e) => { if (e != null) { // 失敗処理 } else { // 成功処理 } });
  8. ϢʔβϩάΠϯ 6OJUZ NCMBUser.LogInAsync("username", "password", (NCMBException e) => { if (e

    != null) { // ログイン失敗 } else { // ログイン成功 } });
  9. "$- J04 NCMBACL *acl = [NCMBACL ACL]; [acl setPublicReadAccess:YES]; NCMBObject

    *obj = [NCMBObject objectWithClassName:@"aclTest"]; [obj setACL:acl]; NSError *e = nil; [obj save:&e];
  10. "$- +BWB4DSJQU var acl = new ncmb.Acl(); acl.setPublicReadAccess(true); var obj

    = ncmb.DataStore("aclTest"); obj.set("acl", acl); obj.save();
  11. "$- 6OJUZ NCMBACL acl = new NCMBACL(); acl.PublicReadAccess = true;

    NCMBObject obj = new NCMBObject("aclTest"); obj.ACL = acl;