-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from charithag/master
Fixed wso2/product-iots#1568
- Loading branch information
Showing
12 changed files
with
144 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
client/client/src/main/java/org/wso2/iot/agent/InstanceIDListenerService.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,7 +79,6 @@ public void run() { | |
} | ||
}, AUTO_HIDE_DELAY_MILLIS); | ||
} | ||
|
||
} | ||
|
||
private void startActivity() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
client/client/src/main/java/org/wso2/iot/agent/services/FCMInstanceIdService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. | ||
* | ||
* WSO2 Inc. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.wso2.iot.agent.services; | ||
|
||
import android.content.Intent; | ||
import android.util.Log; | ||
|
||
import com.google.firebase.iid.FirebaseInstanceId; | ||
import com.google.firebase.iid.FirebaseInstanceIdService; | ||
|
||
import org.wso2.iot.agent.utils.Constants; | ||
import org.wso2.iot.agent.utils.Preference; | ||
|
||
public class FCMInstanceIdService extends FirebaseInstanceIdService { | ||
|
||
private static final String TAG = FCMInstanceIdService.class.getSimpleName(); | ||
|
||
@Override | ||
public void onTokenRefresh() { | ||
// Get updated InstanceID token. | ||
String token = FirebaseInstanceId.getInstance().getToken(); | ||
if (Constants.DEBUG_MODE_ENABLED){ | ||
Log.d(TAG, "FCM Token: " + token); | ||
} | ||
Preference.putString(this, Constants.FCM_REG_ID, token); | ||
Intent intent = new Intent(); | ||
intent.setAction(Constants.FCM_TOKEN_REFRESHED_BROADCAST_ACTION); | ||
sendBroadcast(intent); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.