Пример #1
0
# 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.

from src import push_admin
import json
from src.push_admin import messaging
from examples import push_env

notification = messaging.Notification(title='sample title',
                                      body='sample message body')

android_notification = messaging.AndroidNotification(
    icon='/raw/ic_launcher2',
    color='#AACCDD',
    sound='/raw/shake',
    default_sound=True,
    tag='tagBoom',
    click_action=messaging.AndroidClickAction(action_type=2,
                                              url="https://www.huawei.com"),
    body_loc_key='M.String.body',
    body_loc_args=('boy', 'dog'),
    title_loc_key='M.String.title',
    title_loc_args=["Girl", "Cat"],
    channel_id='Your Channel ID',
    notify_summary='some summary',
# 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.

from src import push_admin
import json
from src.push_admin import messaging

notification = messaging.Notification(
    title='sample title',
    body='sample message body',
    image='https://www.huawei.com/path/icon.png')

android_notification = messaging.AndroidNotification(
    icon='/raw/ic_launcher2',
    color='#AACCDD',
    sound='/raw/shake',
    default_sound=True,
    tag='tagBoom',
    click_action=messaging.AndroidClickAction(action_type=2,
                                              url="https://www.huawei.com"),
    body_loc_key='M.String.body',
    body_loc_args=('boy', 'dog'),
    title_loc_key='M.String.title',
    title_loc_args=["Girl", "Cat"],
    channel_id='Your Channel ID',