implementation 'com.google.android.gms:play-services-ads:19.2.0' - service

when I use last version of 'com.google.android.gms:play-services-ads:19.2.0', I receive an error message. In fact I have performed all the steps as they are in the documentation.
The error message is:
at android.app.ActivityThread.installProvider(ActivityThread.java:5814)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5403)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5342)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1528)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by: java.lang.IllegalStateException:
******************************************************************************
* Invalid application ID. Follow instructions here: *
* https://googlemobileadssdk.page.link/admob-android-update-manifest *
* to find your app ID. *
******************************************************************************
at com.google.android.gms.internal.ads.zzyz.attachInfo(com.google.android.gms:play-services-ads-lite##19.2.0:24)
at com.google.android.gms.ads.MobileAdsInitProvider.attachInfo(com.google.android.gms:play-services-ads-lite##19.2.0:3)
at android.app.ActivityThread.installProvider(ActivityThread.java:5811)
... 10 more

You have to declare your admob application_id in project's manifest XML file like this:
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="#string/your_ad_app_id" />

Firstly, you need to get value for APPLICATION_ID from your Google Admob account and put it on AndroidManifest.xml as below correctly. Your account value starts with "ca-app-pub- *** "
<manifest>
<application>
<!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/>
</application>
</manifest>

<manifest>
<application
android:name="com.google.android.gms.permission.AD_ID">
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy " />
</application>
</manifest>

Related

#ionic-native/zip not working on API 31, open failed: EACCES (Permission denied)

I am working on a legacy ionic-cordova project, running my android app on API level 31 (upgraded recently).
I have android:requestLegacyExternalStorage="true" and the permissions
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
on my AndroidManifest.xml file. Also checked my permissions with 'cordova-plugin-android-permissions' and also 'cordova-diagnostic-plugin' for 'READ_EXTERNAL_STORAGE' & 'WRITE_EXTERNAL_STORAGE' permissions and got granted: true,
But I still can not use the 'cordova-plugin-zip', due to EACCES (Permission denied),
this is the error I get on Android Studio:
2023-01-11 13:06:36.328 14977-22760/es.my-app.my-app E/Zip: An error occurred while unzipping.
java.io.FileNotFoundException: /storage/emulated/0/Download/some-file.KMZ: open failed: EACCES (Permission denied)
at libcore.io.IoBridge.open(IoBridge.java:492)
at java.io.FileInputStream.<init>(FileInputStream.java:160)
at java.io.FileInputStream.<init>(FileInputStream.java:115)
at org.apache.cordova.CordovaResourceApi.openForRead(CordovaResourceApi.java:250)
at org.apache.cordova.CordovaResourceApi.openForRead(CordovaResourceApi.java:233)
at org.apache.cordova.Zip.unzipSync(Zip.java:84)
at org.apache.cordova.Zip.access$000(Zip.java:23)
at org.apache.cordova.Zip$1.run(Zip.java:39)
Previews to the update, the Zip.unzip method from '#ionic-native/zip' used to work fine to decompress my .kmz files, but now it throws an error: -1 due to permissions denied while trying to read from the External Storage.
Finally, I came up with an OK solution, starting from API 31, to have full access to the external storage there is a particular permission: 'MANAGE_EXTERNAL_STORAGE', in order to register my app for that permission, firstly I had to add it to the 'config.xml' file like so:
<widget xmlns:android="http://schemas.android.com/apk/res/android">
<platform name="android">
...
<config-file parent="/manifest" target="AndroidManifest.xml">
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
</config-file>
...
</platform>
</widget>
it is important to add xmlns:android="http://schemas.android.com/apk/res/android" at the widget tag.
Then to request the 'MANAGE_EXTERNAL_STORAGE' permission I modified the .java file of the plugin on android studion like so:
...
public class FileChooser extends CordovaPlugin {
#Override
public boolean execute(String action, JSONArray inputs, CallbackContext callbackContext) throws JSONException {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.R && !android.os.Environment.isExternalStorageManager()) {
try {
Intent intent = new Intent();
intent.setAction(android.provider.Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION);
Uri uri = Uri.fromParts("package", cordova.getContext().getPackageName(), null);
intent.setData(uri);
cordova.getActivity().startActivity(intent);
} catch (Exception e) {
Intent intent = new Intent();
intent.setAction(android.provider.Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION);
cordova.getActivity().startActivity(intent);
}
}
.... plugin code ...
}
}
The execute function is the starting point of execution for the plugin, there, I added the code that requests permission before executing the rest of the plugin processes...
NOTE: with the newer scoped stotage restrictions for android the 'MANAGE_EXTERNAL_STORAGE' permission might make it hard to publish your app on play store, there are other, more complex, strategies to access the external storage that will not cause that trouble.

Flutter facebook app events : lateinit property anonymousId has not been initialized

I'm trying to call Facebook app events in my flutter project.
I'm using the dependency facebook_app_events: ^0.12.0.
meta-data is also added in the manifest file.
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id" />
void callFBEvent() async {
try {
var i = await facebookAppEvents.getAnonymousId();
await facebookAppEvents.setAdvertiserTracking(enabled: true);
await facebookAppEvents.logEvent(
name: "User_Selection_Screen", parameters: {
"User_Selection": "User_Selection",
});
print("facebook event success User_Selection_Screen");
}catch(e){
print(e);
}
}
Getting below error
kotlin.UninitializedPropertyAccessException: lateinit property anonymousId has not been initialized
at id.oddbit.flutter.facebook_app_events.FacebookAppEventsPlugin.handleGetAnonymousId(FacebookAppEventsPlugin.kt:82)
at id.oddbit.flutter.facebook_app_events.FacebookAppEventsPlugin.onMethodCall(FacebookAppEventsPlugin.kt:55)
at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:84)
at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:822)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:336)
at android.os.Looper.loop(Looper.java:174)
at android.app.ActivityThread.main(ActivityThread.java:7386)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)
I open the project in an android module. Then just clean the build of the project first and then just build and sync the Gradle in the android module. then the issue was solved. But I already use pub get lots of time before that but that didn't work. fine, my issue was solved.
In my case the problem was that I inserted the the meta data under actvity tag instead of inserting that under application tag
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/facebook_app_id"/>
So the solution was basically to put the :
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id"/>
<meta-data android:name="com.facebook.sdk.ClientToken"
android:value="#string/facebook_client_token"/>
in the right spot , they need to be under the application Tag , in the first range so not under appliction and then activity tag just under the application tag in the androidManifest just as in the pic below !
enter image description here

How can free switch initiate a conference by a scheduled time

I've tried to set up conference call using asterisk & free switch as well where my SIP soft phone is XLite. I'm able to do conference using both asterisk & free switch with XLite. Now i'm trying the reverse way that instead of endpoints start the conference,let free switch it self to start a conference at a scheduled time.
As per the research i've done I've wrote a dialplan file to make it work out.
These are some application & API which is useful for my idea,
minute-of-day --> for scheduling a task at a perticular time
conference_set_auto_outcall --> for calling endpoints to join a conference
I've added the below to default.xml of dialplan
<extension name = "scheduling" >
<! -- condition is every day at 10 am start conference-->
<condition minute-of-day= "600">
<!-- do conference as action -->
<!--condition field="destination_number" expression="^(3000)$"-->
<action application="answer"/>
<action application="set" data="conference_auto_outcall_timeout=5"/>
<action application="set" data="conference_auto_outcall_flags=none"/>
<action application="set"
data="conference_auto_outcall_caller_id_name=$${effective_caller_id_name}"/>
<action application="set"
data="conference_auto_outcall_caller_id_number=$${effective_caller_id_number}"/>
<action application="set" data="conference_auto_outcall_profile=default"/>
<!-- called to my detsination -->
<action application="conference_set_auto_outcall" data="user/1001#$${domain}"/>
<action application="conference_set_auto_outcall" data="user/1002#$${domain}"/>
<action application="conference_set_auto_outcall" data="user/1003#$${domain}"/>
<action application="conference" data="$1#default"/>
</condition>
</extension>
I'm not able to find out why it's not working ?
atleast some actions it should perform at the scheduled time.
After my changes i've reloaded the xml as well in the below way
start fc_cli & then run reloadxml command
The dialplan extension, and therefore the time-routing condition, will not run on it's own. It has to be called, so unless there is a call transversing the dialplan and triggering that 'scheduling' extension, it will not work. Probably the best way to go about this would be to use the originate command to call the users and then bridge them into the conference:
fs_cli -x "originate sofia/internal/1000#$${domain} &conference($1#default)"
fs_cli -x "originate sofia/internal/1001#$${domain} &conference($1#default)"
fs_cli -x "originate sofia/internal/1002#$${domain} &conference($1#default)"
You can put this on a cron to run on the time you want and it should accomplish what you are trying to do above.

Problems Deploying application to Weblogic through the Admin Console

I'm using Weblogic 10.3.5. When I deploy my Struts2 application locally in eclipse, it runs fine. When I try to deploy my application through the Admin console, I get a Struts 2 error, name not found for action.
When I look at the .war file, it has all the libraries and classes. I followed these directions for deploying through the Admin Console. I can successfully deploy through the Admin Console, but when I try and use the test links for the application, I get the same error. If I try to access the application through the url:
http://localhost:7001/app-name
I get the same error.
Here is the stack trace:
[[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default
(self-tuning)'] WARN org.apache.struts2.dispatcher.Dispatcher - Could
not find action or result: /eServices/login.action There is no Action
mapped for namespace [/] and action name [login] associated with
context path [/eServices]. - [unknown location] at
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:185)
at
org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)
at
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:37)
at
com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)
at
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:552)
at
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
at
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at
oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
at java.security.AccessController.doPrivileged(Native Method) at
oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at
oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
at
oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
at
oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at
oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209) at
weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
What am I doing wrong? Why can I access the application when I deploy it through eclipse, but I can't access the application when I deploy it through the Admin Console.
Thanks for your help!
Sounds like your struts.xml file in WEB-INF/classes is somehow wrong when you're trying a manual deploy. Crack open your .ear/.war file and see what's in your struts.xml (if it even exists). Eclipse might be automatically putting it into a folder for you that doesn't get deployed when you do it manually. Below is a working example for reference:
<struts>
<constant name="struts.devMode" value="true" />
<package name="default" namespace="/" extends="struts-default">
<action name="myAction"
class="com.something.myAction" >
<result name="success">pages/myPage.jsp</result>
</action>
</package>
</struts>
If the project root context is “app-name“, you can access the above action via a URL like –
http://domain:8080/app-name/myAction.action

jboss-esb fs-listener jbm message queue overflow

We have a jboss esb server which is reading files from the file system in a scheduled way (schedule frequency of 20sec) and convert them into the esb message then we parse the message.
There are some other providers/listeners (jms) and services configured on the esb servers. When there is an error in one of the services it effects the above process. File system provider (gateway) is working fine but the jms-listener who takes the gateway messages are not working and lots of messages are accumulated in the jbm queue (jbm_msg Oracle DB table).
Here is the problem, when my server is restarted messages in the jbm-queue is parsed in the esb for just 20 seconds which is the scheduled frequency of fs-provider, never process messages again and cpu usage goes up to 100% and stays there. We believe somehow fs-providers interrupts the jms-provider.
Is there any configuration we have been missing out.
Here are the configuration files that we have:
jboss-esb.xml
<?xml version = "1.0" encoding = "UTF-8"?>
<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
<providers>
<fs-provider name="SitaIstProvider">
<fs-bus busid="gw_sita_ist" >
<fs-message-filter
directory="/ikarussita/IST/IN"
input-suffix=".RCV"
work-suffix=".lck"
post-delete="false"
post-directory="/ikarussita/IST/OK"
post-suffix=".ok"
error-delete="false"
error-directory="/ikarussita/IST/ERR"
error-suffix=".err"/>
</fs-bus>
</fs-provider>
<jms-provider name="SitaESBQueue" connection-factory="ConnectionFactory">
<jms-bus busid="esb_sita_queue">
<jms-message-filter dest-type="QUEUE" dest-name="queue/esb_sita_queue"/>
</jms-bus>
</jms-provider>
</providers>
<services>
<service category="SITA" name="SITA_IST" description="SITA Daemon For ISTCOXH">
<listeners>
<fs-listener name="Sita_Ist_Gateway" busidref="gw_sita_ist" is-gateway="true" schedule-frequency="20" />
<jms-listener name="Jms_Sita_EsbAware" busidref="esb_sita_queue" />
</listeners>
<actions mep="OneWay">
<action name="parse_msg" class="com.celebi.integration.action.sita.inbound.SitaHandler" process="parseMessage" />
<action name="send_ikarus" class="com.celebi.integration.action.ikarus.outbound.fis.FlightJmsSender" />
</actions>
</service>
</services>
</jbossesb>
jbm-queue-service.xml
<?xml version="1.0" encoding="UTF-8"?>
<server>
<mbean code="org.jboss.jms.server.destination.QueueService"
name="jboss.messaging.destination:service=Queue,name=esb_sita_queue"
xmbean-dd="xmdesc/Queue-xmbean.xml">
<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
<depends>jboss.messaging:service=PostOffice</depends>
</mbean>
<server>
deployment.xml
<jbossesb-deployment>
<depends>jboss.messaging.destination:service=Queue,name=esb_sita_queue</depends>
</jbossesb-deployment>
Thanx
Split the service into 2 separate services, one handling the JMS queue, the other the file poller. Specify the same action pipeline. That way you get the same functionality but without the threading issue. Also use max-threads attr on the listener to specify the number of reading threads.