iOS Enterprise update integration - ios

the case: I'm using iOS Enterprise Program for Ionic 2 app. One of issues for such distribution type was in supporting update flow. To solve this, we created simple JSON on server side to check available update. When update is available, user sees alert with suggestion to update app or exit.
app.component.ts
iosUpdateCheck() {
this.http.get(`${this.config.iosEnterpriseEndpoint}latest.json`).map(res =>
<{version: string}>res.json()).subscribe((res) => {
if (res.version !== this.config.appVersionNumber) {
this.message.alertCtrl.create({
title: 'Update is available!',
message: 'Please, update your terminal to proceed',
buttons: [
{
text: 'Update',
handler: () => {
console.log(this.TAG + 'iosUpdateCheck: update clicked');
//I tried just href also
window.window.open(`<a href=itms-services://?action=download-manifest&url=${this.config.iosEnterpriseEndpoint}manifest.plist />`,'_system');
}
},
{
text: 'Exit',
role: 'cancel',
handler: () => {
console.log(this.TAG + 'iosUpdateCheck: exit clicked');
this.platform.exitApp();
}
},
]
}).present();
}
});
}
I also added in config.xml <allow-intent href="itms-services:*"/> but still getting same error(sorry for screenshot, it's impossible to copy error link in Safari):
If I will use just a link it works fine but does not correspond to the objectives pursued.

I think this ionic-native plugin might help you: Ionic Native Market plugin.
Installation:
ionic cordova plugin add cordova-plugin-market
npm install --save #ionic-native/market
And don't for get to add it to your app.module.
Usage:
import { Market } from '#ionic-native/market';
constructor(private market: Market) { }
this.market.open('your.package.name');

Related

sending an email with attachments using 'react-native-mail' library works but didn't receive email

I have a React Native app (Only for IOS) and I implemented a feature where user can share a pdf file via email using the Mail app on ios devices. I used 'react-native-mail' library for this feature and it works great. However, there was one person who said that it did send an email but didn't get an email. Checked spam folder and tried everything we could to find an email. Thought it was an issue with email credentials so we tried with a brand new gmail account but still didn't get an email.
Let me explain how this library works first. You need to set up a gmail account (has to be gmail to get this library to work) in Settings on your ios device (if there are multiple gmail accounts, only the first one is used as a sender for the react-native-mail library.) Then activate mail app with this email account. Go to the app then enter a recipient then send an email with any attachments (for my case, a small pdf file.) then we get an email on the recipient gmail account!
I could be sure an email is sent because when I get the event, it says 'sent'. I tried to reproduce the issue that person had but there was no luck. Here's my code snippet below.
const sharePdf = async () => {
Mailer.mail(
{
subject: 'Assessment Report',
recipients: [currentUser.email ? currentUser.email : ''],
body: 'Assessment Report',
isHTML: true,
attachments: [
{
path: reportUri,
type: 'pdf',
name: 'Report',
},
],
},
(error, event) => {
console.log('error => ', error);
if (error === 'not_available') {
Alert.alert(
'Please add a Gmail (Google) account to your iPad',
'Go to settings > Mail > accounts > Add Account > Google',
[
{
text: 'OK',
onPress: () => console.log('OK: Email Error Response'),
},
],
{cancelable: true},
);
} else {
Alert.alert(
event,
error,
[
{
text: 'Ok',
onPress: () => console.log('OK: Email Error Response'),
},
],
{cancelable: true},
);
}
},
);
};
please help me if anyone has faced this issue or has an idea of fixing this issue.. Thank you :)

React-Native-Firebase: App store not opening when app is not installed on iOS device

Using the React-Native-Firebase Dynamic Links library, I followed the tutorial mentioned here and then I create a Dynamic Link using the following code:
const link = await dynamicLinks().buildLink({
link: "https://myInternalDomainLink.app",
domainUriPrefix: "https://myFirebaseDynamicLink.app",
android: {
packageName: "sample.app"
},
ios: {
bundleId: "sample.app"
},
analytics: {
campaign: "banner",
},
});
When the app is installed on the device, clicking on the link opens the app. That's proper. But if the app is not installed, clicking on the Open button in the browser preview does not open the app store, but instead navigates to the link parameter in the code above.
How can I make the dynamic link which is opened in the browser, to open the app in the App Store instead of navigating to my site's URL?
I found the solution. You have to mention the appStoreId of your iOS app in the ios section in the code for creating a dynamic link:
const link = await dynamicLinks().buildLink({
link: "https://myInternalDomainLink.app",
domainUriPrefix: "https://myFirebaseDynamicLink.app",
android: {
packageName: "sample.app"
},
ios: {
bundleId: "sample.app",
appStoreId: "123456789" // This is the fix
},
analytics: {
campaign: "banner"
},
});

How to launch my electron app from a website

We have an electron crypto app that signs transactions (among other things).
We want other websites to have the ability to have a button that opens that electron app, pre-filled with some params (the transaction information).
flow is:
user clicks "make transaction" on some-crypto-site.com
electron app opens up with pre-filled params
user clicks "sign transaction" in electron app
electron app does stuff behind the scenes
electron app closes and sends a message to some-crypto-site.com
This could be done at runtime, or install time.
What I tried (linux, chrome)
calling app.setAsDefaultProtocolClient with the code of this gist, which is basically:
app.setAsDefaultProtocolClient("my-app")
But after I put my-app://foo?bar=baz in chrome browser, I get the following popup, and pressing open-xdg does nothing (other than dismissing the popup)
I looked into
Electron protocol api which seems to handle in-app protocols only
webtorrent .desktop file This might be the way to go, I'm just not sure how to go about it.
Maybe there's a way to do so at install time through electron builder?
Thanks in advance for the help, I have no idea how to proceed here!
Resources that might be useful
github repo with mac+window example
github comment for linux
github comment for linux 2
SO answer for all 3 OSs
SO windows answer
npm package for windows registery
SO mac answer
SO linux answer
microsoft docs for windows
windows article
github comment for windows
github comment for mac
info.plst for mac
old repo for mac and win
Since this may be relevant to what I’m doing at work, I decided to give it a go.
I’ve only tested this on OSX though!
I looked at the documentation for app.setAsDefaultProtocolClient and it says this:
Note: On macOS, you can only register protocols that have been added to your app's info.plist, which can not be modified at runtime. You can however change the file with a simple text editor or script during build time. Please refer to Apple's documentation for details.
These protocols can be defined when packaging your app with electron-builder. See build:
{
"name": "foobar",
"version": "1.0.0",
"main": "main.js",
"scripts": {
"start": "electron .",
"dist": "electron-builder"
},
"devDependencies": {
"electron": "^3.0.7",
"electron-builder": "^20.38.2"
},
"dependencies": {},
"build": {
"appId": "foobar.id",
"mac": {
"category": "foo.bar.category"
},
"protocols": {
"name": "foobar-protocol",
"schemes": [
"foobar"
]
}
}
}
In your main thread:
const {app, BrowserWindow} = require('electron');
let mainWindow;
function createWindow () {
mainWindow = new BrowserWindow({width: 800, height: 600})
mainWindow.loadFile('index.html');
}
app.on('ready', createWindow);
var link;
// This will catch clicks on links such as open in foobar
app.on('open-url', function (event, data) {
event.preventDefault();
link = data;
});
app.setAsDefaultProtocolClient('foobar');
// Export so you can access it from the renderer thread
module.exports.getLink = () => link;
In your renderer thread:
Notice the use of the remote API to access the getLink function exported in the main thread
<!DOCTYPE html>
<html>
<body>
<p>Received this data <input id="data"/></p>
<script>
const {getLink} = require('electron').remote.require('./main.js');
document.querySelector('#data').value = getLink();
</script>
</body>
</html>
Example
open in foobar
This also allows you to launch from the command line:
open "foobar://xyz=1"
How do you get back to the original caller?
I suppose that when you launch the app you could include the caller url:
<a href="foobar://abc=1&caller=example.com”>open in foobar</a>
When your electron app finishes processing data, it would simply ping back that url
Credits
Most of my findings are based on:
From this GitHub issue
And the excellent work from #oikonomopo
All little bit different from above.
open-url fires before the ready event so you can store it in a variable and use within the widow did-finish-load.
let link;
let mainWindow;
function createWindow() {
mainWindow = new BrowserWindow({
width: 1280,
height: 720,
webPreferences: {
nodeIntegration: true,
contextIsolation: false
}
});
mainWindow.openDevTools();
mainWindow.setContentProtection(true);
mainWindow.loadFile('index.html');
mainWindow.webContents.on("did-finish-load", function() {
mainWindow.webContents.send('link', link);
});
}
app.on('ready', createWindow);
// This will catch clicks on links such as open in foobar
app.on('open-url', function(event, url) {
link = url;
if (mainWindow?.webContents) {
mainWindow.webContents.send('link', link);
}
});
app.setAsDefaultProtocolClient('protocols');
You can then use the value in your render html like this.
<!DOCTYPE html>
<html>
<head></head>
<body>
<script>
const ipc = require("electron").ipcRenderer;
ipc.on("link", function (event, url) {
console.log(url);
console.log(parseQuery(decodeURI(url)));
});
function parseQuery(queryString) {
queryString = queryString.substring(queryString.indexOf("://") + 3);
var query = {};
var pairs = (queryString[0] === "?" ? queryString.substr(1) : queryString).split("&");
for (var i = 0; i < pairs.length; i++) {
var pair = pairs[i].split("=");
query[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1] || "");
}
return query;
}
</script>
</body>
</html>

Google Tag Manager (Firebase) Preview link iOS does not work - Deep Link does not contain valid required params

We integrated Google Tag Manager and Firebase into our iOS app. Everything seems to be integrated correctly (app loads default and remotely defined container and sends events to Firebase, app is opened on preview QR code).
But I have difficulties to use Preview feature on not published version.
What I do:
Currently published container version is 4.
Then I changed the tag - saved changes as a version 5 and used preview feature, which generates begin preview QR Code link - url like https://tagmanager.google.com/mcpr/com.app.XXX?id=GTM-XXXXXX&gtm_auth=7xxhnmjdIb71fZ28PDPmXg&gtm_preview=5
Then I opened app using QR code scan in the device and tried to invoke tag - old version 4 was invoked, but I expected that version 5 with different implementation should be used.
Note: I know that version 4 was used, because my tag renames event name by adding suffix, which is different on version 4 and 5. What is tracked I can see in debug console.
In the log I see:
<FIRAnalytics/DEBUG> Deep Link does not contain valid required params. URL params: {
"gtm_auth" = 7xxhnmjdIb71fZ28PDPmXg;
"gtm_preview" = 5;
id = "GTM-XXXXXX";
}
This is my container definition (json) - version 5:
{
"fingerprint":"NQ$0",
"resource": {
"version":"5",
"macros":[
{
"function":"__e",
"instance_name":"Event Name",
"vendor_template_version":"1"
},
{
"function":"__ai",
"instance_name":"App ID",
"vendor_template_version":"1"
},
{
"function":"__an",
"instance_name":"App Name",
"vendor_template_version":"1"
},
{
"function":"__av",
"instance_name":"App Version Code",
"vendor_template_version":"1"
}
],
"tags":[
{
"function":"__fm",
"instance_name":"Firebase X Tag",
"once_per_event":true,
"vendor_template_version":"1",
"vtp_overrideEventName":["template",["macro",0],"zz"],
"vtp_action":"filter",
"tag_id":2
}
],
"predicates":[
{
"function":"_sw",
"arg0":["macro",0],
"arg1":"test"
}
],
"rules":[
[["if",0],["add",0]]
]
},
"runtime":
[[50,"__ai_main",[46],[36,[2,[17,[15,"gtmUtils"],"mobile"],"applicationId",[7]]]],[50,"__ai",[46,"data"],[36,["__ai_main",[15,"data"]]]],
[50,"__an_main",[46],[36,[2,[17,[15,"gtmUtils"],"mobile"],"applicationName",[7]]]],[50,"__an",[46,"data"],[36,["__an_main",[15,"data"]]]],
[50,"__av_main",[46],[36,[2,[17,[15,"gtmUtils"],"mobile"],"applicationVersion",[7]]]],[50,"__av",[46,"data"],[36,["__av_main",[15,"data"]]]],
[50,"__e_main",[46],[36,[2,[17,[15,"gtmUtils"],"mobile"],"event",[7]]]],[50,"__e",[46,"data"],[36,["__e_main",[15,"data"]]]],
[50,"__fm_main",[46,"a"],[41,"b","c"],[38,[17,[15,"a"],"action"],[46,"measure","filter","block"],[46,[5,[46,[3,"b",[39,[17,[15,"a"],"mergeEventParameters"],[17,[15,"a"],"dropParamTable"],[7]]],["__fm_sendFirebaseEvent",[17,[15,"a"],"eventName"],[17,[15,"a"],"editParamTable"],[15,"b"],[17,[15,"a"],"mergeEventParameters"]],[4]]],[5,[46,[3,"c",[30,[17,[15,"a"],"overrideEventName"],[2,[17,[15,"gtmUtils"],"mobile"],"event",[7]]]],["__fm_sendFirebaseEvent",[15,"c"],[17,[15,"a"],"editParamTable"],[17,[15,"a"],"dropParamTable"],true],[2,[17,[15,"gtmUtils"],"mobile"],"suppressPassthrough",[7]],[4]]],[5,[46,[2,[17,[15,"gtmUtils"],"mobile"],"suppressPassthrough",[7]],[4]]],[9,[46,[36]]]]]],[50,"__fm_sendFirebaseEvent",[46,"a","b","c","d"],[41,"e","f","g","h","i","j"],[3,"e",[30,[2,[17,[15,"gtmUtils"],"common"],"tableToMap",[7,[15,"b"],"editParamKey","editParamValue"]],[8]]],[22,[28,["__fm_validateEventData",[15,"a"],[15,"e"]]],[46,[36]]],[3,"f",[7]],[47,"g",[15,"c"],[46,[2,[15,"f"],"push",[7,[16,[16,[15,"c"],[15,"g"]],"dropParamKey"]]]]],[3,"h",[39,[15,"d"],[2,[17,[15,"gtmUtils"],"mobile"],"eventParameters",[7]],[8]]],[3,"h",[30,[15,"h"],[8]]],[47,"i",[15,"e"],[46,[22,[12,[2,[15,"f"],"indexOf",[7,[15,"i"]]],[27,1]],[46,[43,[15,"h"],[15,"i"],[16,[15,"e"],[15,"i"]]]],[46,[2,[17,[15,"gtmUtils"],"common"],"log",[7,"w",[0,[0,"Dropped param ",[15,"i"]]," is also specified in param override table"]]]]]]],[3,"j",[8]],[47,"i",[15,"h"],[46,[22,[12,[2,[15,"f"],"indexOf",[7,[15,"i"]]],[27,1]],[46,[43,[15,"j"],[15,"i"],[16,[15,"h"],[15,"i"]]]]]]],[2,[17,[15,"gtmUtils"],"mobile"],"sendMeasurement",[7,[15,"a"],[15,"j"]]]],[50,"__fm_validateEventData",[46,"a","b"],[41,"c"],[22,[30,[12,[2,[15,"a"],"charAt",[7,0]],"_"],[28,[2,[15,"a"],"match",[7,"^[A-Za-z0-9_]*$"]]]],[46,[2,[17,[15,"gtmUtils"],"common"],"log",[7,"w",[0,[0,[0,"Invalid Event name: ",[15,"a"]]," (Must not start with an underscore and must consist of letters,"]," digits and/or underscores)"]]],[36,false]]],[47,"c",[15,"b"],[46,[22,[30,[12,[2,[15,"c"],"charAt",[7,0]],"_"],[28,[2,[15,"c"],"match",[7,"^[A-Za-z0-9_]*$"]]]],[46,[2,[17,[15,"gtmUtils"],"common"],"log",[7,"w",[0,[0,[0,"Invalid parameter name: ",[15,"c"]]," (Must not start with an underscore and must consist of"]," letters, digits and/or underscores)"]]],[36,false]]]]],[36,true]],[50,"__fm",[46,"data"],[36,["__fm_main",[15,"data"]]]],
[50,"main",[46,"a"],[43,[17,[15,"a"],"common"],"tableToMap",[15,"tableToMap"]],[43,[17,[15,"a"],"common"],"stringify",[15,"stringify"]]],[50,"tableToMap",[46,"a","b","c"],[41,"d","e","f"],[3,"d",[8]],[3,"e",false],[3,"f",0],[42,[1,[15,"a"],[23,[15,"f"],[17,[15,"a"],"length"]]],[33,[15,"f"],[3,"f",[0,[15,"f"],1]]],false,[46,[22,[1,[1,[16,[15,"a"],[15,"f"]],[2,[16,[15,"a"],[15,"f"]],"hasOwnProperty",[7,[15,"b"]]]],[2,[16,[15,"a"],[15,"f"]],"hasOwnProperty",[7,[15,"c"]]]],[46,[43,[15,"d"],[16,[16,[15,"a"],[15,"f"]],[15,"b"]],[16,[16,[15,"a"],[15,"f"]],[15,"c"]]],[3,"e",true]]]]],[36,[39,[15,"e"],[15,"d"],[45]]]],[50,"stringify",[46,"a"],[41,"b","c","d","e"],[22,[20,[15,"a"],[45]],[46,[36,"null"]]],[22,[20,[15,"a"],[44]],[46,[36,[44]]]],[22,[30,[12,[40,[15,"a"]],"number"],[12,[40,[15,"a"]],"boolean"]],[46,[36,[2,[15,"a"],"toString",[7]]]]],[22,[12,[40,[15,"a"]],"string"],[46,[36,[0,[0,"\"",[2,[2,[15,"a"],"split",[7,"\""]],"join",[7,"\\\""]]],"\""]]]],[22,[2,[17,[15,"gtmUtils"],"common"],"isArray",[7,[15,"a"]]],[46,[3,"b",[7]],[3,"c",0],[42,[23,[15,"c"],[17,[15,"a"],"length"]],[33,[15,"c"],[3,"c",[0,[15,"c"],1]]],false,[46,[3,"d",["stringify",[16,[15,"a"],[15,"c"]]]],[22,[12,[15,"d"],[44]],[46,[2,[15,"b"],"push",[7,"null"]]],[46,[2,[15,"b"],"push",[7,[15,"d"]]]]]]],[36,[0,[0,"[",[2,[15,"b"],"join",[7,","]]],"]"]]]],[22,[12,[40,[15,"a"]],"object"],[46,[3,"b",[7]],[47,"e",[15,"a"],[46,[3,"d",["stringify",[16,[15,"a"],[15,"e"]]]],[22,[29,[15,"d"],[44]],[46,[2,[15,"b"],"push",[7,[0,[0,[0,"\"",[15,"e"]],"\":"],[15,"d"]]]]]]]],[36,[0,[0,"{",[2,[15,"b"],"join",[7,","]]],"}"]]]],[2,[17,[15,"gtmUtils"],"common"],"log",[7,"e","Attempting to stringify unknown type!"]],[36,[44]]]]
}
And container version 4:
{
"fingerprint":"NA$0",
"resource": {
"version":"4",
"macros":[
{
"function":"__e",
"instance_name":"Event Name",
"vendor_template_version":"1"
},
{
"function":"__ai",
"instance_name":"App ID",
"vendor_template_version":"1"
},
{
"function":"__an",
"instance_name":"App Name",
"vendor_template_version":"1"
},
{
"function":"__av",
"instance_name":"App Version Code",
"vendor_template_version":"1"
}
],
"tags":[
{
"function":"__fm",
"instance_name":"Firebase X Tag",
"once_per_event":true,
"vendor_template_version":"1",
"vtp_overrideEventName":["template",["macro",0],"yy"],
"vtp_action":"filter",
"tag_id":2
}
],
"predicates":[
{
"function":"_sw",
"arg0":["macro",0],
"arg1":"test"
}
],
"rules":[
[["if",0],["add",0]]
]
},
"runtime":
[[50,"__ai_main",[46],[36,[2,[17,[15,"gtmUtils"],"mobile"],"applicationId",[7]]]],[50,"__ai",[46,"data"],[36,["__ai_main",[15,"data"]]]],
[50,"__an_main",[46],[36,[2,[17,[15,"gtmUtils"],"mobile"],"applicationName",[7]]]],[50,"__an",[46,"data"],[36,["__an_main",[15,"data"]]]],
[50,"__av_main",[46],[36,[2,[17,[15,"gtmUtils"],"mobile"],"applicationVersion",[7]]]],[50,"__av",[46,"data"],[36,["__av_main",[15,"data"]]]],
[50,"__e_main",[46],[36,[2,[17,[15,"gtmUtils"],"mobile"],"event",[7]]]],[50,"__e",[46,"data"],[36,["__e_main",[15,"data"]]]],
[50,"__fm_main",[46,"a"],[41,"b","c"],[38,[17,[15,"a"],"action"],[46,"measure","filter","block"],[46,[5,[46,[3,"b",[39,[17,[15,"a"],"mergeEventParameters"],[17,[15,"a"],"dropParamTable"],[7]]],["__fm_sendFirebaseEvent",[17,[15,"a"],"eventName"],[17,[15,"a"],"editParamTable"],[15,"b"],[17,[15,"a"],"mergeEventParameters"]],[4]]],[5,[46,[3,"c",[30,[17,[15,"a"],"overrideEventName"],[2,[17,[15,"gtmUtils"],"mobile"],"event",[7]]]],["__fm_sendFirebaseEvent",[15,"c"],[17,[15,"a"],"editParamTable"],[17,[15,"a"],"dropParamTable"],true],[2,[17,[15,"gtmUtils"],"mobile"],"suppressPassthrough",[7]],[4]]],[5,[46,[2,[17,[15,"gtmUtils"],"mobile"],"suppressPassthrough",[7]],[4]]],[9,[46,[36]]]]]],[50,"__fm_sendFirebaseEvent",[46,"a","b","c","d"],[41,"e","f","g","h","i","j"],[3,"e",[30,[2,[17,[15,"gtmUtils"],"common"],"tableToMap",[7,[15,"b"],"editParamKey","editParamValue"]],[8]]],[22,[28,["__fm_validateEventData",[15,"a"],[15,"e"]]],[46,[36]]],[3,"f",[7]],[47,"g",[15,"c"],[46,[2,[15,"f"],"push",[7,[16,[16,[15,"c"],[15,"g"]],"dropParamKey"]]]]],[3,"h",[39,[15,"d"],[2,[17,[15,"gtmUtils"],"mobile"],"eventParameters",[7]],[8]]],[3,"h",[30,[15,"h"],[8]]],[47,"i",[15,"e"],[46,[22,[12,[2,[15,"f"],"indexOf",[7,[15,"i"]]],[27,1]],[46,[43,[15,"h"],[15,"i"],[16,[15,"e"],[15,"i"]]]],[46,[2,[17,[15,"gtmUtils"],"common"],"log",[7,"w",[0,[0,"Dropped param ",[15,"i"]]," is also specified in param override table"]]]]]]],[3,"j",[8]],[47,"i",[15,"h"],[46,[22,[12,[2,[15,"f"],"indexOf",[7,[15,"i"]]],[27,1]],[46,[43,[15,"j"],[15,"i"],[16,[15,"h"],[15,"i"]]]]]]],[2,[17,[15,"gtmUtils"],"mobile"],"sendMeasurement",[7,[15,"a"],[15,"j"]]]],[50,"__fm_validateEventData",[46,"a","b"],[41,"c"],[22,[30,[12,[2,[15,"a"],"charAt",[7,0]],"_"],[28,[2,[15,"a"],"match",[7,"^[A-Za-z0-9_]*$"]]]],[46,[2,[17,[15,"gtmUtils"],"common"],"log",[7,"w",[0,[0,[0,"Invalid Event name: ",[15,"a"]]," (Must not start with an underscore and must consist of letters,"]," digits and/or underscores)"]]],[36,false]]],[47,"c",[15,"b"],[46,[22,[30,[12,[2,[15,"c"],"charAt",[7,0]],"_"],[28,[2,[15,"c"],"match",[7,"^[A-Za-z0-9_]*$"]]]],[46,[2,[17,[15,"gtmUtils"],"common"],"log",[7,"w",[0,[0,[0,"Invalid parameter name: ",[15,"c"]]," (Must not start with an underscore and must consist of"]," letters, digits and/or underscores)"]]],[36,false]]]]],[36,true]],[50,"__fm",[46,"data"],[36,["__fm_main",[15,"data"]]]],
[50,"main",[46,"a"],[43,[17,[15,"a"],"common"],"tableToMap",[15,"tableToMap"]],[43,[17,[15,"a"],"common"],"stringify",[15,"stringify"]]],[50,"tableToMap",[46,"a","b","c"],[41,"d","e","f"],[3,"d",[8]],[3,"e",false],[3,"f",0],[42,[1,[15,"a"],[23,[15,"f"],[17,[15,"a"],"length"]]],[33,[15,"f"],[3,"f",[0,[15,"f"],1]]],false,[46,[22,[1,[1,[16,[15,"a"],[15,"f"]],[2,[16,[15,"a"],[15,"f"]],"hasOwnProperty",[7,[15,"b"]]]],[2,[16,[15,"a"],[15,"f"]],"hasOwnProperty",[7,[15,"c"]]]],[46,[43,[15,"d"],[16,[16,[15,"a"],[15,"f"]],[15,"b"]],[16,[16,[15,"a"],[15,"f"]],[15,"c"]]],[3,"e",true]]]]],[36,[39,[15,"e"],[15,"d"],[45]]]],[50,"stringify",[46,"a"],[41,"b","c","d","e"],[22,[20,[15,"a"],[45]],[46,[36,"null"]]],[22,[20,[15,"a"],[44]],[46,[36,[44]]]],[22,[30,[12,[40,[15,"a"]],"number"],[12,[40,[15,"a"]],"boolean"]],[46,[36,[2,[15,"a"],"toString",[7]]]]],[22,[12,[40,[15,"a"]],"string"],[46,[36,[0,[0,"\"",[2,[2,[15,"a"],"split",[7,"\""]],"join",[7,"\\\""]]],"\""]]]],[22,[2,[17,[15,"gtmUtils"],"common"],"isArray",[7,[15,"a"]]],[46,[3,"b",[7]],[3,"c",0],[42,[23,[15,"c"],[17,[15,"a"],"length"]],[33,[15,"c"],[3,"c",[0,[15,"c"],1]]],false,[46,[3,"d",["stringify",[16,[15,"a"],[15,"c"]]]],[22,[12,[15,"d"],[44]],[46,[2,[15,"b"],"push",[7,"null"]]],[46,[2,[15,"b"],"push",[7,[15,"d"]]]]]]],[36,[0,[0,"[",[2,[15,"b"],"join",[7,","]]],"]"]]]],[22,[12,[40,[15,"a"]],"object"],[46,[3,"b",[7]],[47,"e",[15,"a"],[46,[3,"d",["stringify",[16,[15,"a"],[15,"e"]]]],[22,[29,[15,"d"],[44]],[46,[2,[15,"b"],"push",[7,[0,[0,[0,"\"",[15,"e"]],"\":"],[15,"d"]]]]]]]],[36,[0,[0,"{",[2,[15,"b"],"join",[7,","]]],"}"]]]],[2,[17,[15,"gtmUtils"],"common"],"log",[7,"e","Attempting to stringify unknown type!"]],[36,[44]]]]
}
Make sure to clear cookies on your device. Also, stop any script or ad blocking services from running in the background, which could interfere with GTM's preview mode, too.
Disclaimer: This may not apply to your setup, I can speak for Desktop environments only.
Did you follow all the steps described in this tutorial ?
Especially the part where you add URL types in your plist file.
Uninstall and reinstall the app otherwise, and rather than the QR code, use directly the link. As last option, try this on an emulator rather than on a real device.

iOS Device Token & Push Notification Ionic

Can someone help on how to get device token on ios using ionic only. I've managed to get device token using Xcode but is it possible to get device token using ionic only?
I need to to add the device token when the users log in the app
Try this
using this plugin
cordova plugin add phonegap-plugin-push --variable SENDER_ID="XXXXXXX"
after that adding this
in to ionicPlatform.ready
var push = PushNotification.init({
"android": {
"senderID": "SENDER-ID"
},
"ios": {"alert": "true", "badge": "true", "sound": "true"},
"windows": {}
});
push.on('registration', function(data) {
console.log("registration event");
//here is your registration id
console.log(data.registrationId);
});
I may be very late in answering your question, your answer is as below
Update your ionic to latest version i,e v2 and above.
Then create a project and add this plugin
cordova plugin add phonegap-plugin-push --variable
SENDER_ID="XXXXXXXXX
Next goto src/app/app.component.ts file and add this code after platform.ready().then(()
var push = Push.init({
android: {
senderID: "XXXXXXXXX"
},
ios: {
alert: "true",
badge: true,
sound: 'false'
},
windows: {}
});
push.on('registration', (data) => {
console.log(data.registrationId);
alert(data.registrationId.toString());
});
push.on('notification', (data) => {
console.log(data);
alert("Hi, Am a push notification");
});
Perform all the certification part according to apple guidelines(if
any problem please do comment).
Finally implement push notification server side either in java or php or ionic.io ! All the best...

Resources