I've successfully integrated phonegap + childbrowser on android app. Now I want 开发者_JAVA百科to integrate twitter sharing in my app. I followed the tutorial http://www.wisejive.com/2010/11/phonegap-jquery-mobile-twitter-and.html I completed all the steps in the correct possible way but I couldn't successfully execute it. This is my error log from logcat:
09-09 17:59:30.810: DEBUG/ChildBrowser(602): Hey I got a page started for url = http://compucloud.in/?oauth_token=MY_OAUTH_TOKEN&oauth_verifier=MY_OAUTH_VERIFIER
09-09 17:59:30.921: DEBUG/dalvikvm(602): GC_FOR_MALLOC freed 7717 objects / 506680 bytes in 90ms
09-09 17:59:31.021: DEBUG/PhoneGapLog(602): file:///android_asset/www/js/childbrowser.js: Line 51 : In _onEvent
09-09 17:59:31.021: INFO/Web Console(602): In _onEvent at file:///android_asset/www/js/childbrowser.js:51
09-09 17:59:31.091: DEBUG/PhoneGapLog(602): file:///android_asset/www/js/childbrowser.js: Line 52 : data type = 1
09-09 17:59:31.091: INFO/Web Console(602): data type = 1 at file:///android_asset/www/js/childbrowser.js:52
09-09 17:59:31.101: DEBUG/PhoneGapLog(602): file:///android_asset/www/js/childbrowser.js: Line 53 : url = http://compucloud.in/?oauth_token=MY_OAUTH_TOKEN&oauth_verifier=MY_OAUTH_VERIFIER
09-09 17:59:31.101: INFO/Web Console(602): url = http://compucloud.in/?oauth_token=MY_OAUTH_TOKEN&oauth_verifier=MY_OAUTH_VERIFIER at file:///android_asset/www/js/childbrowser.js:53
09-09 17:59:31.120: DEBUG/PhoneGapLog(602): file:///android_asset/www/js/twHelper.js: Line 129 : this could be the req. thing : ----http://compucloud.in/?oauth_token=MY_OAUTH_TOKEN&oauth_verifier=MY_OAUTH_VERIFIER ----]
09-09 17:59:31.120: INFO/Web Console(602): this could be the req. thing : ----http://compucloud.in/?oauth_token=MY_OAUTH_TOKEN&oauth_verifier=MY_OAUTH_VERIFIER ----] at file:///android_asset/www/js/twHelper.js:129
09-09 17:59:31.131: DEBUG/PhoneGapLog(602): file:///android_asset/www/js/twHelper.js: Line 130 : indexof value:__0__
09-09 17:59:31.131: INFO/Web Console(602): indexof value:__0__ at file:///android_asset/www/js/twHelper.js:130
09-09 17:59:31.140: DEBUG/PhoneGapLog(602): file:///android_asset/www/js/twHelper.js: Line 131 : Token Check: undefined
09-09 17:59:31.140: INFO/Web Console(602): Token Check: undefined at file:///android_asset/www/js/twHelper.js:131
09-09 17:59:31.490: DEBUG/PhoneGapLog(602): file:///android_asset/www/phonegap-1.0.0.js: Line 645 : Error in success callback: ChildBrowser2 = TypeError: Result of expression 'requestToken' [null] is not an object.
09-09 17:59:31.490: INFO/Web Console(602): Error in success callback: ChildBrowser2 = TypeError: Result of expression 'requestToken' [null] is not an object. at file:///android_asset/www/phonegap-1.0.0.js:645
09-09 17:59:31.660: DEBUG/PhoneGapLog(602): file:///android_asset/www/js/childbrowser.js: Line 51 : In _onEvent
09-09 17:59:31.660: INFO/Web Console(602): In _onEvent at file:///android_asset/www/js/childbrowser.js:51
09-09 17:59:31.670: DEBUG/PhoneGapLog(602): file:///android_asset/www/js/childbrowser.js: Line 52 : data type = 0
09-09 17:59:31.670: INFO/Web Console(602): data type = 0 at file:///android_asset/www/js/childbrowser.js:52
09-09 17:59:31.670: DEBUG/PhoneGapLog(602): file:///android_asset/www/js/childbrowser.js: Line 53 : url = undefined
09-09 17:59:31.680: INFO/Web Console(602): url = undefined at file:///android_asset/www/js/childbrowser.js:53
These are my custom generated logs. I'm not able to get requested tokens from twitter somehow as it returns error in the middle of the process. I've got no clue about the returned error. Please guide me if anyone knows about the error or have done this before.
Thanks in advance!
I've been able to user twitter in my android/phonegap app using ChildBrowser (the version released a few days ago) and bytespider's jsOAuth (search on github). The jsOAuth readme has links to examples near the bottom.
The tutorial you reference was written for iOS. The log output you included doesn't help much.
Thanks for all the response. The tutorial I followed, indeed, is for iOS cause I couldn't find one for Twitter. BTW, I've finished my requirements using the new ChildBrowser http://simonmacdonald.blogspot.com/2011/09/phonegap-android-childbrowser-revamp.html.
I'll be posting a tutorial on my blog in about a week. Please wait for it. I'll post the links. Thanks
精彩评论