2013年3月20日水曜日

phonegap-facebook-plugin



















phoneGap 2.5 
+ phonegap-facebook-plugin + facebook SDK3.2 Xcode 4.6.1 iOS(phoneGap)で facebook の
javascript SDKを動かす 




まず、phoneGapをインストールして
コマンドラインより、Xcode の
プロジェクトを作成 作成したプロジェクトを実行してみる






ダウロードした phoneGap の zip ファイルを解凍し、
解凍したディレクトリに移動して create を実行
$ cd phonegap-2.5.0/
$ ./lib/ios/bin/create ./HelloFBjs HelloFBjs HelloFBjs



作成された project を Xcode で開き、
実行してエラーがないことを確認
一部、警告が表示されるが 表示部分をコメントアウトして
config.xml に同等の内容を追記













































appId を設定し fql も動作OK

           document.addEventListener('deviceready', function() {
                                      try {
                                      alert('Device is ready! Make sure you set your app_id below this alert.');
                                      FB.init({ appId: "XXXXX", nativeInterface: CDV.FB, useCachedDialogs: false });
                                      document.getElementById('data').innerHTML = "";
                                      } catch (e) {
                                      alert(e);
                                      }
                                      }, false);



   *     FB.login(function(response) {
   *       if (response.authResponse) {
   *         // if you need to know which permissions were granted then
   *         // you can can make an fql-call
   *         FB.api({
   *                  method: 'fql.query',
   *                  query: 'select read_stream, publish_stream, ' +
   *                    'offline_access from permissions where uid=me()'
   *                },
   *                function (data) {
   *                  if (data[0].read_stream) {
   *                    // we have read_stream
   *                  }
   *                });
   *       } else {
   *         // user is not logged in
   *       }
   *     }, {scope:'read_stream, publish_stream, offline_access'});

2013年3月19日火曜日

PhoneGap 2.5 and WebKitStoreWebDataForBackup

WebKitStoreWebDataForBackup は NSUserDefaultsに設定する
バンドルされる XXX-info.plist ではない


http://developer.apple.com/library/ios/#releasenotes/General/RN-iOSSDK-6_0/index.html
In iOS 6 and later, web data (SQL Web Storage and LocalStorage) from a UIWebView object can be stored in a directory that will be backed up. To enable backing up this data, set the WebKitStoreWebDataForBackup key to YES in your app’s user defaults. This should be done only if your app relies on web content data that cannot be reloaded. If your UIWebView object opens links to arbitrary web content, this key should be set to NO. Toggling the value of this key will not preserve existing web view data.

$ ./lib/ios/bin/create ./HelloWorld org.apache.cordova.HelloWorld HelloWorld
$ pwd
/Users/XXX/phonegap-2.5.0

 [[NSUserDefaults standardUserDefaults] setBool:[backupType isEqualToString:@"cloud"] forKey:@"WebKitStoreWebDataForBackup"];

 backupType = @"cloud"

 

http://phonegap-fan.com/ use Splashscreen is deprecated. http://docs.phonegap.com/en/2.5.0/cordova_splashscreen_splashscreen.md.html#Splashscreen

Unityでドアの開閉はAnimatorそれともiTween?

Mac Mini M2 の Unity で Sketchup のデータを復元したつづき。 以前、苦労して作成したドアの開閉が動作しないので修復する。 どうやって動かしていたのか、また忘れそうなので記録しておく。             Animator 左右のドア PlaneL,...