Hi,
I need to implement a button in my Ionic app which should redirect the user to the store ( Apple or Google Play store ) in order to facilitate them to post an app review.
Since I suppose the app should redirect them to the App Store, openning the right section (review section), I have no clue how to do this with Ionic.
Could you guys help me?
Thanks,
Igor O. Sá
I’m also looking for solution for this issue. I have implemented a button but the xcode gives me this error when I press the button on my device
"Failed to load webpage with error: CDVWebViewDelegate: Navigation started when state=1"
This is how I implemented the button:
.controller('infoPageCtrl', function($scope){
$scope.targetLink;
$scope.$on("$ionicView.beforeEnter", function() {
var phoneModel = device.platform;
if (phoneModel === 'Android') {
$scope.targetLink = 'https://play.google.com/store/apps/developer?id=zadgroup';
} else if (phoneModel === 'iOS') {
$scope.targetLink = 'https://itunes.apple.com/us/artist/zad-group-for-computer-services/id341310117';
}
else{
$scope.targetLink = 'http://www.google.com/';
}
});
$scope.directToStore = function(){
window.open($scope.targetLink);
}
})
Hi Aljathmi,
I could do that, recently.
Check my solution:
var URL_APP = {
REVIEW_IOS: “itms-apps://itunes.apple.com/app/idAPPID”,
REVIEW_ANDROID: “market://details?id=com.appid”
};
$scope.onReviewClick = function(){
var isIOS = ionic.Platform.isIOS() || ionic.Platform.isIPad();
var isAndroid = ionic.Platform.isAndroid();
if (isIOS) {
window.open(URL_APP.REVIEW_IOS, '_system', 'location=yes');
}
else if (isAndroid) {
window.open(URL_APP.REVIEW_ANDROID, '_system', 'location=yes');
}
}
Thanks!
Igor O. Sá
1 Like
Thanks @igordeoliveirasa
It worked for me by adding InAppBrowser plugin and replacing:
window.open($scope.targetLink);
with:
window.open($scope.targetLink, '_system', 'location=yes');