To set the defaults in the firebase remoteconfig we need to use for example a xml with the content...
Asume that the file is placed in res/xml/ and it is named remoteconfigdefaults.xml
it contains:
How do i get the id of the xml to use it in the wrapper?
i tried it with
with
and i tried it with remoteconfigdefaults and remoteconfigdefaults.xml as string in the methodcall.
All does not work and results in a resourceId of 0
How do i get the id of an xml resource? Where do i need to place the xml?
Asume that the file is placed in res/xml/ and it is named remoteconfigdefaults.xml
it contains:
<?xml version="1.0" encoding="utf-8"?>
<!-- START xml_defaults -->
<defaultsMap>
<entry>
<key>price_prefix</key>
<value>Your price is $</value>
</entry>
<entry>
<key>loading_phrase</key>
<value>Checking your price…</value>
</entry>
<entry>
<key>is_promotion_on</key>
<value>false</value>
</entry>
<entry>
<key>price</key>
<value>100</value>
</entry>
<entry>
<key>discount</key>
<value>0</value>
</entry>
</defaultsMap>
<!-- END xml_defaults -->
How do i get the id of the xml to use it in the wrapper?
B4X:
/**
* Sets defaults in the default namespace,
* using an XML resource.
* @param resourceId
*/
public void setDefaults (String resource){
BA.Log("Calling SetDefaults... "+resource);
int resourceId=BA.applicationContext.getResources().getIdentifier(resource, "string", BA.packageName);
BA.Log("resourceID="+resourceId);
getObject().setDefaults(resourceId);
}
i tried it with
B4X:
int resourceId=BA.applicationContext.getResources().getIdentifier(resource, "string", BA.packageName);
B4X:
int resourceId=BA.applicationContext.getResources().getIdentifier(resource, "xml", BA.packageName);
and i tried it with remoteconfigdefaults and remoteconfigdefaults.xml as string in the methodcall.
All does not work and results in a resourceId of 0
How do i get the id of an xml resource? Where do i need to place the xml?