FCM error third-party-auth-error occurred several device - firebase-cloud-messaging

i have an error when i send FCM with sendMulticast()
almost devices are OK... but some iOS devices has an error occurred with code messaging/third-party-auth-error
i don't know why some device Ok but some devieces wrong...
please tell me some...
i use node.js v14 and firebase-admin lib
FirebaseMessagingError: Auth error from APNS or Web Push Service
at Function.fromServerError (D:\develop\node_modules\firebase-admin\lib\utils\error.js:254:16)
at createFirebaseError (D:\develop\node_modules\firebase-admin\lib\messaging\messaging-errors-internal.js:35:47)
at D:\develop\node_modules\firebase-admin\lib\messaging\messaging-api-request-internal.js:96:29
at Array.map (<anonymous>)
at D:\develop\node_modules\firebase-admin\lib\messaging\messaging-api-request-internal.js:95:30
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at sendFCMMessage (D:\develop\api\utils\local\fcm.ts:76:25)
at sendFCMMessageToUser (D:\develop\api\utils\local\fcm.ts:168:5)
at main (D:\develop\prisma\test.ts:76:5) {
errorInfo: {
code: 'messaging/third-party-auth-error',
message: 'Auth error from APNS or Web Push Service'
},
codePrefix: 'messaging'
}

Related

Expo app is throwing when locally hosted api is called

I am using expo in my project and I hosted a local server for API. When I try connecting the API with the expo project it gives me network error:
error Error: Network Error
at createError (F:\Projects\react-native-food-app\node_modules\axios\lib\core\createError.js:16:15)
at XMLHttpRequest.handleError (F:\Projects\react-native-food-app\node_modules\axios\lib\adapters\xhr.js:117:14)
at XMLHttpRequest.dispatchEvent (F:\Projects\react-native-food-app\node_modules\event-target-shim\dist\event-target-shim.js:818:35)
at XMLHttpRequest.setReadyState (F:\Projects\react-native-food-app\node_modules\react-native\Libraries\Network\XMLHttpRequest.js:609:16)
at XMLHttpRequest.__didCompleteResponse (F:\Projects\react-native-food-app\node_modules\react-native\Libraries\Network\XMLHttpRequest.js:396:12)
at F:\Projects\react-native-food-app\node_modules\react-native\Libraries\Network\XMLHttpRequest.js:517:9
at RCTDeviceEventEmitter.emit (F:\Projects\react-native-food-app\node_modules\react-native\Libraries\vendor\emitter\_EventEmitter.js:135:33)
at MessageQueue.__callFunction (F:\Projects\react-native-food-app\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:414:27)
at F:\Projects\react-native-food-app\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:113:12
at MessageQueue.__guard (F:\Projects\react-native-food-app\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:365:9)
This is the code for API calling
const instance = axios.create({
baseURL: "http://127.0.0.1:8000/api/",
});
It works just fine in insomnia but throws an error when I call the API in expo
expo is not support localhost server.
you must use the ip instead of localhost
ipconfig #window
networksetup -getinfo Wi-Fi #mac
and then
const instance = axios.create({
baseURL: "http://192.168.0.100:8000/api/",
});

WebRTC Error - Session error description: Data channel type mismatch. Expected RTP, got SCTP

I am new to WebRTC and triyng to create my first app. I have found this article https://www.tutorialspoint.com/webrtc/webrtc_quick_guide.htm and did as it was said there. The resulted app works fine if I test it in the Chrome. But when I try to test this app in 2 browser (Chrome and Mozilla) it gives me this error:
Uncaught (in promise) DOMException: Failed to execute
'setRemoteDescription' on 'RTCPeerConnection': Session error code:
ERROR_CONTENT. Session error description: Data channel type mismatch.
Expected RTP, got SCTP..
This happens when I send an offer from Mozilla client and Chrome client tries to give an answer to this offer in this part of code:
myConnection.setRemoteDescription(new RTCSessionDescription(offer));
myConnection.createAnswer(function (answer) {
myConnection.setLocalDescription(answer);
send({
type: "answer",
answer: answer
});
}, function (error) {
alert("oops...error"); //<-- this alert fires all the time
});
I have googled this and all I have found is set new RTCPeerConnection(configuration, { optional: [{RtpDataChannels: false}] }) but if I do so then when I try to send a message it says that dataChannel.readyState is not openned.
What do I do wrong? Any help appriciated!
Thanks!
Remove optional: [{RtpDataChannels: true}] and then wait for the datachannel.onopen event to fire before attempting to send messages.

Can't fetch data from local api React-Native

I have a web application, in react using an API made in Laravel. I want to make a mobile app using the same API. I can't fetch data, because I get NETWORK REQUEST FAILED error. This is how I try to fetch data:
handleButton = () => {
try {
fetch(`127.0.0.1:8081/test`).then(response =>
console.log(response)
);
} catch (e) {
console.log(e);
}
};
I tried changing the ip in dev settings to my machine id, i tried using localhost not the ip(127.0.0.1) but none of those fixed it... I can't seem to find anything else. Here is the error text:
Possible Unhandled Promise Rejection (id: 0):
TypeError: Network request failed
TypeError: Network request failed
at XMLHttpRequest.xhr.onerror (blob:http://localhost:8081/cfc373de-8318-4df3-b46a-7b17d4926c5e:42556:18)
at XMLHttpRequest.dispatchEvent (blob:http://localhost:8081/cfc373de-8318-4df3-b46a-7b17d4926c5e:47998:27)
at XMLHttpRequest.setReadyState (blob:http://localhost:8081/cfc373de-8318-4df3-b46a-7b17d4926c5e:46859:20)
at XMLHttpRequest.__didCompleteResponse (blob:http://localhost:8081/cfc373de-8318-4df3-b46a-7b17d4926c5e:46686:16)
at blob:http://localhost:8081/cfc373de-8318-4df3-b46a-7b17d4926c5e:46796:47
at RCTDeviceEventEmitter.emit (blob:http://localhost:8081/cfc373de-8318-4df3-b46a-7b17d4926c5e:16875:37)
at MessageQueue.__callFunction (blob:http://localhost:8081/cfc373de-8318-4df3-b46a-7b17d4926c5e:16488:44)
at blob:http://localhost:8081/cfc373de-8318-4df3-b46a-7b17d4926c5e:16245:17
at MessageQueue.__guard (blob:http://localhost:8081/cfc373de-8318-4df3-b46a-7b17d4926c5e:16442:13)
at MessageQueue.callFunctionReturnFlushedQueue (blob:http://localhost:8081/cfc373de-8318-4df3-b46a-7b17d4926c5e:16244:14)
EDIT:
I am using android studio's emulator, because i don't have an android device running android > 5
Use the IP of your machine on the local network.
Open up terminal/cmd.
If you're using a mac, you can use ifconfig and it's usually under en0. You will see something like 192.168.0.32 or similar.
If you're using windows, you can use ipconfig.

tokbox : Subscriber time out error on Safari

Using opentok.js v2,  the video channel works fine with Chrome and Firefox . The opentok version used is from this link: https://static.opentok.com/v2/js/opentok.min.js
But it doesn't work with safari 11.0.3.
On session's stream created event, it generates following error message "The stream was unable to connect due to a network error. Make sure your connection isnt blocked by a firewall"
The publisher is published successfully i.e session.publish(..) works fine.
The code below is used to make a video call:
this.session=OT.initSession(this.apiKey, this.sessionId);
this.session.on({
streamCreated: (event) => {
 
this.session.subscribe(event.stream, 'subscriber');
},
streamDestroyed: (event) => {
console.log(`Stream ${event.stream.name} ended because ${event.reason}`);
}
});
this.session.connect(this.token, () => {
this.publisher=OT.initPublisher('publisher');
this.session.publish(this.publisher);
});
}
 
Other exceptions in console generated by opentok.js are as follows: 
[Error] OT.exception :: title: undefined (1554) msg: OT.Subscriber PeerConnection Error: OT.Subscriber failed to subscribe to a stream in a reasonable amount of time
error
_exceptionHandler (vendor.js:150924)
handleJsException (vendor.js:151002)
onPeerConnectionFailure (vendor.js:162673)
(anonymous function) (vendor.js:162414)
onInvokeTask (vendor.js:4239)
runTask (polyfills.js:3:10225)
invokeTask (polyfills.js:3:16182)
n (polyfills.js:2:31400)
[Error] OT_ICE_WORKFLOW_FAILED: ICEWorkflow: Subscriber PeerConnection with connection (not found) failed: OT.Subscriber failed to subscribe to a stream in a reasonable amount of time
error
dispatchOTError (vendor.js:159161)
(anonymous function) (vendor.js:160080)
handleThisOnce (vendor.js:137437)
(anonymous function) (vendor.js:137675)
onInvokeTask (vendor.js:4239)
runTask (polyfills.js:3:10225)
invokeTask (polyfills.js:3:16182)
n (polyfills.js:2:31400)
[Error] OT.exception :: title: undefined (1554) msg: ICEWorkflow: Subscriber PeerConnection with connection (not found) failed: OT.Subscriber failed to subscribe to a stream in a reasonable amount of time
error
_exceptionHandler (vendor.js:150924)
handleJsException (vendor.js:151002)
dispatchOTError (vendor.js:159163)
(anonymous function) (vendor.js:160080)
handleThisOnce (vendor.js:137437)
(anonymous function) (vendor.js:137675)
onInvokeTask (vendor.js:4239)
runTask (polyfills.js:3:10225)
invokeTask (polyfills.js:3:16182)
n (polyfills.js:2:31400)
 
 
All the above errors  are generated only on Safari browser. 
You need to make sure you have created a Safari Project in your OpenTok Account Portal. More details at https://tokbox.com/developer/sdks/js/safari/
It looks like you're using a polyfills.js file. If that is the polyfill from Angular that includes zone.js then you will need to include the fix for RTCPeerConnections 'zone.js/dist/webapis-rtc-peer-connection' in your polyfills.js file.
import 'zone.js/dist/webapis-rtc-peer-connection';
You will also probably want to include the polyfill for getUserMedia. More details at https://github.com/angular/zone.js/issues/948#issuecomment-357558384

Cannot connect to MobileFirst Server during initialization

I am testing developing a Hybrid application in MobileFirst Studio and want to connect to MobileFirst Server during the app init. I updated main.js file under MF_Project/app/[appNanme]/common/js/main.js init method with the following:
WL.Client.connect({
onSuccess: function() {
WL.Logger.info("onSuccess: connection success");
},
onFailure: function(err) {
WL.Logger.info("onFailure: Exception: " + err);
}
});
I then build the app for Android environment (right click the appName the one under MF_Project and select "Build for Android environment"). Then I ran the app as Android Application in emulator, but the log comes back with error
01-25 16:04:29.364: E/NONE(2755): Invalid invocation of method WL.Client.connect; Invalid value 'undefined' (undefined), expected type 'function'.
01-25 16:04:29.368: E/NONE(2755): Invalid invocation of method WL.Client.connect; Invalid options attribute 'onSuccess'. Invalid invocation of method WL.Client.connect; Invalid value 'undefined' (undefined), expected type 'function'.
Any insight on this would be appreciated.
I have tested the supplied project in MFP 6.3 using a Nexus 5 device running Android 5.0.1.
The application successfully connected to the MFP Server.
In the log I saw the SUCCESSFUL: [object object] message.
[object object] because you did not JSON.stringify the result.
For example: WL.Logger.info("SUCCESSFUL: " + JSON.stringify(response));
I think something is wrong with your generated AVD - try to create a new one, in addition to testing in an actual device.