Incorporated a +1 button within my application: https://i.sstatic.net/1IHni.png
The code used:
<div class="g-plusone" data-size="tall" data-href="GOOGLE PLAY STORE LINK TO MY APP"></div>
also executed this script:
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/platform.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
Ensured API access in the following files:
index.html:
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://apis.google.com">
config.xml:
<allow-navigation href="https://apis.google.com" />
Encountered Issue: The functionality works on the browser (ionic serve) but fails within the app... Upon clicking, no action takes place... (no error prompts either)
Is there a feasible solution to make it function within the app? (ionic run)
Addendum/Debug Information:
- After selecting the +1 button on the web interface, it does not display the red button on the app ( Indicates shared link history and lack of user identification...)
- No intention to implement login/signup credentials, just aim to incorporate a +1 button...
If I insert:
<allow-navigation href="*" />
within config.xml, upon clicking the +1 button, a login prompt appears: (Not intended behaviour) https://i.sstatic.net/zAQWVl.png
Indicating that the +1 button remains non-functional due to being "in an anonymous browser", lacking authentication with the OS...
Pursued creation of a demonstration pure Android application adhering to these guidelines: https://developers.google.com/+/mobile/android/recommend Operating seamlessly... (+1 functionality present and functional...)
Tackling potential solutions:
Implementing a native Android view embedding the +1 button into the webview.
Crafting a pseudo +1 button which upon clicking, triggers a plugin invoking a request/action on the actual +1 button....
Open to suggestions/input on resolving this situation?
Feasibility of either alternatives?
Appreciate your guidance!