Ошибка социальной рассылки phonegap: невозможно прочитать свойство 'socialsharing' из неопределенного

Я создаю свое приложение, поэтому нужно использовать социальный обмен... я попробовал:

AndroidManifest.xml

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

config.xml

<gap:plugin name="nl.x-services.plugins.socialsharing" />

<feature name="SocialSharing">
    <param name="android-package" value="nl.xservices.plugins.SocialSharing" />
</feature>

скачайте файл примера zip и скопируйте SocialSharing.js в каталог 'js'

а также:

<p id="placeholder2" class="calculatePlace" onclick="shareMe()"></p>

покажи мне функцию:

function shareMe(){
    console.log('Index.html >> Sharing ...');
    window.plugins.socialsharing.share('Test Share', null, null, 'http://google.com');

// window.plugins.socialsharing.share ('Поделиться текстом'); }

и скопируйте файл "SocialSharing.java" в "каталог_проектов \src\nl\xservices\plugins"

и logcat показывает мне:

04-06 17:11:35.953  20095-20095/com.emaarit.app.sample V/webview﹕ singleCursorHandlerTouchEvent -getEditableSupport  FASLE
04-06 17:11:36.265  20095-20095/com.emaarit.app.sample D/CordovaLog﹕ file:///android_asset/www/index.html: Line 30 : Index.html >> Sharing ...
04-06 17:11:36.265  20095-20095/com.emaarit.app.sample I/Web Console﹕ Index.html >> Sharing ... at file:///android_asset/www/index.html:30
04-06 17:11:36.265  20095-20095/com.emaarit.app.sample D/CordovaLog﹕ file:///android_asset/www/index.html: Line 31 : Uncaught TypeError: Cannot read property 'socialsharing' of undefined
04-06 17:11:36.273  20095-20095/com.emaarit.app.sample E/Web Console﹕ Uncaught TypeError: Cannot read property 'socialsharing' of undefined at file:///android_asset/www/index.html:31

когда я хочу установить плагин, запустите 'командная строка node.js' (Windows 7) от имени администратора и введите следующую команду:

npm install -d cordova plugin add https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git

это показывает мне ошибку:

npm info it worked if it ends with ok
npm info using npm@1.4.23
npm info using node@v0.10.31
npm info retry fetch attempt 1 at 16:15:35
npm http GET https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git

npm info trying registry request attempt 1 at 16:15:35
npm http GET https://registry.npmjs.org/plugin
npm info trying registry request attempt 1 at 16:15:35
npm http GET https://registry.npmjs.org/cordova
npm info trying registry request attempt 1 at 16:15:35
npm http GET https://registry.npmjs.org/add
npm http 304 https://registry.npmjs.org/cordova
npm http 304 https://registry.npmjs.org/add
npm http 304 https://registry.npmjs.org/plugin
npm http 200 https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git

npm ERR! not a package C:\Users\USER7~1.EMI\AppData\Local\Temp\npm-1140-PenpyXjc
\github.com\EddyVerbruggen\SocialSharing-PhoneGap-Plugin.git
npm ERR! Error: ENOENT, open 'C:\Users\USER7~1.EMI\AppData\Local\Temp\npm-1140-P
enpyXjc\github.com\EddyVerbruggen\SocialSharing-PhoneGap-Plugin.git-unpack\packa
ge.json'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-d" "cordova" "plugin" "add"
 "https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git"
npm ERR! cwd C:\Users\user7.EMIT
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! path C:\Users\USER7~1.EMI\AppData\Local\Temp\npm-1140-PenpyXjc\github.c
om\EddyVerbruggen\SocialSharing-PhoneGap-Plugin.git-unpack\package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\user7.EMIT\npm-debug.log
npm ERR! not ok code 0

как это решить?

0 ответов

Другие вопросы по тегам